element-hq / element-hq/dendrite
The value of notification_count in unread_notifications returned by "/sync" is wrong
- Dominant language
- Go
- Stars
- 965
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
*This issue was originally created by [**@MyYuan**](https://github.com/MyYuan) at .*
Before sending a message, make a /sync request. If there are no new messages, the request will block and not return. At this time, another user sends a new message through the /send request, and the notification_count value in the unread_notifications returned by the /sync interface is wrong.
As shown below:

Returns correctly, notification_count should be equal to 1, not 0
Contributor guide
Research direction
Start at the /sync entry point and trace how unread_notifications and notification_count are calculated while a request is blocked. Reproduce the sequence with no new messages, a waiting /sync, and another user's /send request, then verify that the returned notification_count is 1 rather than 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100