stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

onBackgroundEventReceived is called when app goes in foreground

Open flodaniel opened this issue 2 years ago • 3 comments

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

flodaniel avatar Dec 04 '23 14:12 flodaniel

Just noticed that version 7 was published today. Sadly still reproducable on v7.

flodaniel avatar Dec 04 '23 14:12 flodaniel

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.

flodaniel avatar Dec 05 '23 06:12 flodaniel

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Feb 17 '24 01:02 github-actions[bot]

Hey @flodaniel, I can confirm I can replicate this issue.

Investigating it now and hopefully will have a fix soon.

d3xvn avatar Jul 08 '24 09:07 d3xvn

Probable fix for this issue is up and should be rolled out in the next release.

d3xvn avatar Jul 08 '24 10:07 d3xvn