Hello guys, i am developing a chat app with graphq...
# random
i
Hello guys, i am developing a chat app with graphql subscriptions and i am using websockets for the pub/sub system. However when the phone looses websocket connection with the server, no messages are received. What should be done to receive all the missed messages whenever the connection reastablished
a
I would keep track of the updatedAt field of the chat messages you receive through websockets, and when reconnecting, query all messages from that datetime.
i
ye i do that at the moment, the problem is only that the package subscriptions-transport-ws somehow don't call on the reconnected event
always
a
Just to be sure, you did set
reconnect: true
?
i
reconnect: true, lazy: true, timeout: 3000, reconnectionAttempts: 1000000,
sometimes it does call the event, some times not
+ if it calls it, it takes real long to reconnect
a
Sorry, no idea why...
i
ye really weird
the funny part is, if i go airplane mode on my mobile
and i send some messages from other device, and turn off the airplane mode and then send from the other client the message, it comes through the websocket but the event is not called
the reconnect event