Unread counter vs visual unread messages marker discrepancy
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 587
- Avg merge
- 18h 27m
- Merged PRs (30d)
- 333
Description
Steps to reproduce
- Requires https://github.com/nextcloud/spreed/pull/5945 to be merged already
- Create a conversation A and have other users post a lot of messages (ex: bot or script)
- Go to another conversation B and then wait until conversation A has 40+ messages
- Stop activity in A so that no new messages are posted
- Go back to conversation A
- Scroll down more than one page but not to the bottom
- Wait for the left sidebar to reload (~ 30 seconds)
Expected behaviour
The number of unread messages visible in the left sidebar matches the number I see below the unread marker.
Actual behaviour
Due to the discrepancy between visual read marker and store read marker, the left sidebar will already update to a lower number than what is visible.
Note: usually the visual marker would update its position if you switch away to another window and then come back ("focus" event)
Talk app
Talk app version: 13.0.0 commit 48a06781dd6bc895f46d4967ef72ed6f7aaea813
Solutions
Keep left sidebar counter behind
After fetching the list of conversations, directly check if we have a visual marker in the current conversation and update the number of unread messages to match that.
In general: we should still update to the new value if the user switches to another conversation.
Update the visual marker upon fetch
After fetching the list of conversations, also update the marker position in the current chat.
Drawback: the reason for the visual marker position was that the user is not surprised by seeing it jump.
This solution would make it jump at an unpredictable moment and would likely make the behavior feel random and broken.
Ignore
Maybe this is not such big an issue and can be ignored.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the conversation A/B scenario with 40+ messages, then inspect the code that fetches the conversation list, maintains the visual unread marker, and updates the sidebar counter. Compare the visual marker and store read marker after scrolling and waiting for the sidebar reload. Done means the sidebar count matches the unread marker without an unexpected marker jump.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100