Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Unread count keeps showing up for some rooms #13196

Closed
afranke opened this issue Jul 6, 2022 · 5 comments · Fixed by #13223
Closed

Unread count keeps showing up for some rooms #13196

afranke opened this issue Jul 6, 2022 · 5 comments · Fixed by #13223
Labels
A-Push Issues related to push/notifications S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release

Comments

@afranke
Copy link

afranke commented Jul 6, 2022

Description

A private room I’m in keeps showing a (2) unread message count on client launch, both on Element Web and Android, even after I cleared cache.

Steps to reproduce

  • got some messages in a specific private room
  • read them on Element Web (the count disappears)
  • left home, started Element Android, the count appeared again for that room but no new message was visible; opening the room here makes the count go away again
  • went back home, started Element Web again, the same count was back again.
  • read the room again, did a clear cache & reload, the count is back again.

This all happened within the past 24 hours. During that time, I also have had counts appear on direct conversations with no new events while the Web client was running. That is not as reproducible though.

Homeserver

matrix.org

Synapse Version

1.61.0

Installation Method

No response

Platform

🤷 matrix.org

Relevant log output

I don’t have access to that.

Anything else that would be useful to know?

No response

@DMRobertson
Copy link
Contributor

got some messages in a specific private room

Are you able to share the room ID for debugging?

@afranke
Copy link
Author

afranke commented Jul 6, 2022

!zMjRxBhQzSpwVQMPLS:gnome.org

@DMRobertson DMRobertson added A-Push Issues related to push/notifications T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release S-Minor Blocks non-critical functionality, workarounds exist. labels Jul 7, 2022
@kittykat
Copy link
Contributor

kittykat commented Jul 8, 2022

I'm getting this issue annoyingly often for !TxHCEvTmqctXITtVQO:matrix.org last night and this morning

I would like to challenge the S-Minor label as the product is severely impaired if read rooms keep telling you that there are new messages in there wanting attention.

@erikjohnston
Copy link
Member

Aha! I think I've spotted the problem. We don't correctly take into account the receipts at:

sql = """
SELECT user_id, room_id,
coalesce(old.%s, 0) + upd.cnt,
upd.stream_ordering
FROM (
SELECT user_id, room_id, count(*) as cnt,
max(stream_ordering) as stream_ordering
FROM event_push_actions
WHERE ? < stream_ordering AND stream_ordering <= ?
AND %s = 1
GROUP BY user_id, room_id
) AS upd
LEFT JOIN event_push_summary AS old USING (user_id, room_id)
"""

which is usually fine as we will have deleted push actions that have been read, except for highlights. Which is why we see the problem in DMs

@afranke
Copy link
Author

afranke commented Jul 8, 2022

The room I was reporting this for is not a DM but the latest message does indeed contain a highlight to me. It has also been edited, hence a (2) count. It checks out. 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Push Issues related to push/notifications S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants