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

Unread count goes from zero through the roof after restarting the app #25479

Open
Tracked by #24392
Johennes opened this issue May 30, 2023 · 15 comments
Open
Tracked by #24392

Unread count goes from zero through the roof after restarting the app #25479

Johennes opened this issue May 30, 2023 · 15 comments
Labels
A-Notifications O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@Johennes
Copy link
Contributor

Steps to reproduce

  1. Go to inbox zero in https://matrix.to/#/#ps-features-team:matrix.org
  2. Restart and relaunch Element Desktop
  3. Open the room
  4. Notice how the unread count slowly jumps up to ~500

Outcome

What did you expect?

Lots of messages are marked unread

What happened instead?

No unread count in the room

Operating system

macOS

Application version

Element Desktop nightly

How did you install the app?

No response

Homeserver

element.io

Will you send logs?

Yes

@turt2live
Copy link
Member

I've noticed this primarily on DMs, ftr

@Johennes
Copy link
Contributor Author

Can't reproduce the rapidly rising unread count anymore as of this morning. Travis had posted to the main timeline in the room to clear his stuck notification which might be related.

@weeman1337 weeman1337 added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow labels May 31, 2023
@weeman1337
Copy link
Contributor

I can also see this problem from time to time. That happens rarely.

@weeman1337 weeman1337 added O-Occasional Affects or can be seen by some users regularly or most users rarely and removed O-Uncommon Most users are unlikely to come across this or unexpected workflow labels May 31, 2023
@Johennes Johennes assigned germain-gg and unassigned t3chguy May 31, 2023
@germain-gg
Copy link
Contributor

This issue is a duplicate of #25450

Digging through the logs I can find the following exception

2023-05-30T14:48:53.690Z E Error sending receipt {"room":"!pDXDyxlzCKaaGYESIR:matrix.org","error":{"httpStatus":400,"url":"https://element.ems.host/_matrix/client/r0/rooms/!pDXDyxlzCKaaGYESIR%3Amatrix.org/receipt/m.read/%24JgIrwa6haKY-PoeAGUzyzR3Ceii9ywNLl_057T39dPg","errcode":"M_INVALID_PARAM","data":{"errcode":"M_INVALID_PARAM","error":"event_id $JgIrwa6haKY-PoeAGUzyzR3Ceii9ywNLl_057T39dPg is not related to thread main"},"name":"M_INVALID_PARAM"}}

The last event in the main live timeline is a reaction that belongs to a thread. Your accumulated read receipt refers to an older event.
What happens is that the client tries to send a read receipt agains the latest event in the live timeline, but it should not have ended up there.
The client eagerly clears the notification count, but the API call fails, and this failure mode is not taken into account... which means that upon a restart, your accumulated read receipt and the server read receipt has not changed because the API call has failed, you're therefore replaying the notification.

@turt2live
Copy link
Member

@gsouquet I've definitely seen this happen when it's not a reaction in the main timeline. It appears others have as well (rageshakes hopefully inbound on this).

@weeman1337
Copy link
Contributor

If this is a release blocker and a duplicate of #25450, should the other issue become a release blocker?

@Johennes
Copy link
Contributor Author

Johennes commented Jun 1, 2023

Yes, good catch. Have made it so. We've internally been treating it like this already.

@Johennes
Copy link
Contributor Author

Johennes commented Jun 2, 2023

I'm still seeing this on nightly 2023060102 which includes matrix-org/matrix-js-sdk#3427. Have logged https://github.com/matrix-org/element-web-rageshakes/issues/21713. Reopening this but taking off the release blocker label because the general stuck notification experience is much better on this version.

@nadonomy
Copy link
Member

If it helps, I'm experiencing this when clicking on 'mark as read'. It's happened to me twice in the last few days but I wasn't able to rageshake. Will do so next time.

@davidegirardi
Copy link

davidegirardi commented Jun 30, 2023

The latest Element Nightly 2023062901 seems to go through the roof and back to zero by itself, if it helps.

@aurorasmiles
Copy link

Not sure if it's actually the same issue, but I've started experiencing this randomly on Element Web v1.11.35 every other day now. I click on a room that has an (actual) unread message, and sometimes it just starts marking thee last couple hundred messages or so as unread in that room

@Johennes
Copy link
Contributor Author

Yes, that sounds exactly like what I'm seeing, too

@thibaultamartin
Copy link
Contributor

There is a reproducer in https://github.com/matrix-org/element-web-rageshakes/issues/22619, with videos to show it in action, and notification debug information for the room where the issue is happening

@colans
Copy link

colans commented Oct 31, 2023

If it helps, I'm experiencing this when clicking on 'mark as read'. It's happened to me twice in the last few days but I wasn't able to rageshake. Will do so next time.

See #26475 for this; I just created it.

@davidegirardi
Copy link

I can reproduce this consistently with Element Nightly version: 2023112101 Crypto version: Olm 3.2.15.

Steps:

  • Go to an active room with threads
  • Make sure your right panel is closed
  • Restart or refresh Element Nightly
  • Open a thread from the timeline which will open the panel on the right
  • Read the thread
  • Click on the left arrow at the top of the threads side panel to show all the threads
  • Look at the notification count skyrocket while Element renders events like /confetti or 🎉 at the same time

Bonus: scroll up to get even more unreads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Notifications O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests