-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline Mode Chat Issues: Message Sending Errors and Unnecessary API Calls #2737
Comments
Could you please provide more details on how you are handling the client? |
I have stacked my chat component around stack screens as below:
then i am handling client. connect method in my
and also i have declared chat client into my seperate stream class like below:
|
Hi @Vijay-Magadum , Sending messages failing while in offline mode is definitely expected and is the intended behaviour. Since you're offline the messages automatically get marked as errored ones and once you've regained connection you can retry sending those. Not particularly sure why the errors occur with the typing API but I'll have a look at that and get back to you. |
hey @isekovanic is there any API method that can track all unsend messages and once i go online it will automatically send all those messages to that specific channels? |
Hi @Vijay-Magadum , there is nothing out of the box for this behaviour and I unfortunately cannot give you an estimate on if/when this would be added to our upstream. You can try playing around with |
Thanks @isekovanic, I will check this out in the meantime |
Hi @Vijay-Magadum, I opened a PR that should fix the the typing event warnings you've been getting while offline. You should get notified on this GH issue whenever it's merged and deployed and we can close it then. Thanks for the report ! |
Sure @isekovanic, also in the terminal i am getting errors as below and for sending message i am getting axios timout error and when i turn on internet the message will not deliver, i have to press on resend button manually everytime, so is it expected or needs to be checked?
|
Yes, that's expected as mentioned above - we do not automatically send failed messages, but rather give the user the responsibility to do so at their own leisure. |
Hi @Vijay-Magadum , Release Can you please try on this one and see if the issues persist (regarding the warnings). |
hey @isekovanic, Yeah the issue is gone but it is occurring some time until i reload the app in offline mode |
should we expect this change in v6 or are you thinking of changing this in later releases? If not then can we change some methods from module and make it work for us that can show one tic in offline mode |
This might be the leeway time required for our SDK to figure out its websocket connection has died (i.e internet has gone down). This doesn't happen every time the net connection flickers but rather has a buffer. Also, if you're testing on a simulator for this and in a debug build, keep in mind that connects/disconnects to Metro might be causing this entire process to slow down a bit (since we're actually interested whether the WS connection has failed rather than if the internet flickered in order to send these events, since if it recovers we'd like to resend them for sure).
We might have this in our roadmap but it's really early to say right now since we have other priorities. For now, you can perhaps try looking at this hook. It is an internal one and not really meant to be used externally, but it's a simpler one so it might be okay for you. It should contain the latest messages and within their bodies you can see them as failed by their Unfortunately there isn't anything else available that I could offer right now. |
hey @isekovanic, Thanks for the fix and the clarification |
hey Guys,
I have enabled offline support by adding the
enableOfflineSupport
prop to the chat component, and I am able to retrieve channels while offline. I have also added a database logger to track the queries for each operation. However, my problem arises when using the chat in offline mode. It is not sending messages and is throwing errors. Additionally, the event API is triggered for every word I type, which should be ignored while in offline mode. How can I fix these issues? Please help me with this.Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-10-29.at.10.46.59.mp4
The text was updated successfully, but these errors were encountered: