Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room notification count not always decreasing when redacting messages #15698

Open
matrixbot opened this issue Dec 21, 2023 · 0 comments
Open

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 21, 2023

This issue has been migrated from #15698.


Description

When unread messages get redacted, the room notification count sometimes does not decrease accordingly and instead gets stuck. Said differently: if a user has some unread messages in a room, and isn't looking at this room, and if these unread messages are redacted/removed by someone else, the unread count for this room usually decreases accordingly, but sometimes doesn't and gets stuck. One way to unblock/reset it is to open that room. The behaviour isn't very consistent, but very easy to repro with the steps below by repeating them once or twice if the issue doesn't surface the first time.

Repro steps:

  • As user A create channel 1
  • As user B join channel 1
  • As user A open another channel than channel1
  • As user B send 5 messages in channel1
  • As user A see that the notification count for channel1 is 5
  • As user B redact the 5 messages sent in channel1 one by one
  • As user A check the notification count for channel1. Sometimes the result will be 0 as expected, but sometimes it will be a number between 1 and 5 which isn't expected. If the notification count is 0, try again the same steps until hitting the issue (may need to repeat once or twice).

image

This is reproducible on https://app.element.io/

By "room notification count", I mean rooms.join[“roomId”]. unread_notifications.notification_count from the /sync response.

On a stack where I have DB access, this is what appears in event_push_actions and event_push_summary in an example where 4 messages were sent, 2 redacted, and the notification count was stuck at 4 instead of 2:

select * FROM event_push_actions where user_id = 'userId' and room_id = 'roomId';
 room_id | event_id | user_id | profile_tag | actions | topological_ordering | stream_ordering | notif | highlight | unread | thread_id 
----------------------------------------------+----------------------------------------------+-----------------------------------------
 roomId  | $event1  | userId  |             |         |                   71 |         2226732 |     1 |         0 |      0 | main
 roomId  | $event2  | userId  |             |         |                   72 |         2226733 |     1 |         0 |      0 | main
select * from event_push_summary where user_id = 'userId' and room_id = 'roomId';
 user_id | room_id | notif_count | stream_ordering | unread_count | last_receipt_stream_ordering | thread_id 
----------------------------------------------------------------+-------------------------------------------
 userId  | roomId  |           4 |         2226735 |            0 |                      2226260 | main

So event_push_actions correctly indicates the 2 unread, but event_push_summary incorrectly indicates a notif_count of 4 instead of 2.

Steps to reproduce

Repro steps:

  • As user A create channel 1
  • As user B join channel 1
  • As user A open another channel than channel1
  • As user B send 5 messages in channel1
  • As user A see that the notification count for channel1 is 5
  • As user B redact the 5 messages sent in channel1 one by one
  • As user A check the notification count for channel1. Sometimes the result will be 0 as expected, but sometimes it will be a number between 1 and 5 which isn't expected. If the notification count is 0, try again the same steps until hitting the issue (may need to repeat once or twice).

image

This is reproducible on https://app.element.io/

Homeserver

matrix.org

Synapse Version

1.85.0rc1 (b=matrix-org-hotfixes,4427151a21)

Installation Method

Docker (matrixdotorg/synapse)

Database

Not sure what https://app.element.io/ is using

Workers

I don't know

Platform

Not sure what https://app.element.io/ is using

Configuration

No response

Relevant log output

NA

Anything else that would be useful to know?

No response

@matrixbot matrixbot changed the title Dummy issue Room notification count not always decreasing when redacting messages Dec 22, 2023
@matrixbot matrixbot reopened this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant