onBackgroundEventReceived is called when app goes in foreground
Which packages are you using?
stream_chat_flutter, stream_chat_persistance, stream_chat_localizations
On what platforms did you experience the issue?
Android
What version are you using?
stream_chat_flutter: 6.12.0 stream_chat_localizations: 5.12.0 stream_chat_persistence: 6.10.0
What happened?
I receive a message.new event in onBackgroundEventReceived when i should not as the app is in foreground.
I also receive old message.new events, so that even if i have the chat view open, seeing a message from another user, as soon as the app goes to the background, i get the message.new event from that message.
Steps to reproduce
1. Go to the chat view
2. Receive a message from another user
3. Background and foreground the app
4. Message.new event is received even though the app is in foreground.
Supporting info to reproduce
No response
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Just noticed that version 7 was published today. Sadly still reproducable on v7.
We used the onBackgroundEventReceived to show push notifications for the time where the app was in the background but the websocket was still connected. I am not certain what changed, but the push notifications now show either way. This means this bug is no longer blocking for is.
I would still consider it a bug as onBackgroundEventReceived should only receive those events that are coming in while the app is in the background.
This issue is stale because it has been open for 20 days with no activity.
Hey @flodaniel, I can confirm I can replicate this issue.
Investigating it now and hopefully will have a fix soon.
Probable fix for this issue is up and should be rolled out in the next release.