FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
108 stars 18 forks source link

Chat - last_message_seen_by updating incorrectly #2719

Open kcmccart opened 3 months ago

kcmccart commented 3 months ago

Has your issue been reported?

Current Behavior

I added the Chat + Group (Threads) flow template to my app. Everything is working except for the "last_message_seen_by" field is not behaving properly. When a new message is sent, the field updates to include chat users that are signed into the app even if they have not visited the chat details page. It's as though just opening the app is being treated as loading the chat page. This is preventing users from knowing when they have unread messages.

Expected Behavior

Only when a user navigates to the chat details page or on the data change of the chat thread component should they be added to the "last_message_seen_by". All the logic in the default flow seems correct but this is not how the app is behaving.

Steps to Reproduce

  1. Add Chat + Group (Threads) flow, or the bubble version, to the app.
  2. Deploy and use the app on two devices.
  3. Start a chat between users and send some messages.
  4. Have one user not be in the chat and send them a message. They will be marked as having read the message.

Reproducible from Blank

Bug Report Code (Required)

IT40z8mB34ZOm8hE0LrubMFvoCo5JmI8a4IJ0dVRaCotCLbkOpgcf/fOYkRDTfGjY0FcPWKKgWoW0fzmuN71JfpdGwicb4B51s59EwKVLXylWpC6FJWgVGpAL8pWC2qc4KWg2BFSNbFsSF5n202uF+uyZAzqHqK0DjAwDq/LZO4=

Context

This is preventing users of my app from knowing when they have unread messages.

Visual documentation

In this clip, a message "test message" is sent by user "Keanen McCarthy" to the current user. You can see that the unread indicator briefly shows and then disappears because the current user was add to the "last_message_seen_by" field for that chat, even though the user never went into the chat to read the message.

https://github.com/FlutterFlow/flutterflow-issues/assets/166986446/e7533c5c-f7da-4772-b207-0ead9fc5586b

Additional Info

No response

Environment

- FlutterFlow version: 4.1
- Platform: Web/iOS/Android
- Browser name and version: Chrome 123.0.6312.107
- Operating system and version affected: Web/iOS/Android (all platforms)
rzambroni commented 3 months ago

Hey @kcmccart, i was able to replicate the issue you are describing. It looks like a bug in the programming logic of the flow. Will send it over to the team so they can take a look.

Thanks for the report.

kcmccart commented 2 months ago

Thank you @rzambroni. Is there an estimate for when this will be fixed?

rzambroni commented 2 months ago

Hey @kcmccart, unfortunately I don't have an estimate of when it could be fixed. We will post an update as soon as we have it here on the ticket. Thanks!