element-hq / element-hq/dendrite

The value of notification_count in unread_notifications returned by "/sync" is wrong

Open
#2,970 1 comment 0 reactions 0 assignees View on GitHub
C-Sync-API C-User-API O-Frequent T-Defect X-Fix-With-Monolith
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:
image

Returns correctly, notification_count should be equal to 1, not 0

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.