mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
fix: Use graphqlTransportWs to automatically ping server and prevent timeouts
This commit is contained in:
parent
e0232bfa44
commit
7c28f92581
|
@ -100,8 +100,9 @@ abstract class GraphQLApiMap {
|
||||||
Future<GraphQLClient> getSubscriptionClient() async {
|
Future<GraphQLClient> getSubscriptionClient() async {
|
||||||
final WebSocketLink webSocketLink = WebSocketLink(
|
final WebSocketLink webSocketLink = WebSocketLink(
|
||||||
'ws://api.$rootAddress/graphql',
|
'ws://api.$rootAddress/graphql',
|
||||||
|
// Only [GraphQLProtocol.graphqlTransportWs] supports automatic pings, so we don't disconnect when nothing happens.
|
||||||
|
subProtocol: GraphQLProtocol.graphqlTransportWs,
|
||||||
config: SocketClientConfig(
|
config: SocketClientConfig(
|
||||||
// TODO: Figure out the keep alive pings, as the app disconnects after 30s of inactivity.
|
|
||||||
autoReconnect: true,
|
autoReconnect: true,
|
||||||
initialPayload: _token.isEmpty
|
initialPayload: _token.isEmpty
|
||||||
? null
|
? null
|
||||||
|
|
Loading…
Reference in a new issue