ulyssa / iamb

A Matrix client for Vim addicts
https://iamb.chat
Apache License 2.0
608 stars 45 forks source link

Rooms get incorrectly marked as unread on startup #292

Open immae opened 4 months ago

immae commented 4 months ago

When I start iamb (version 0.0.9), multiple rooms (both "public" and "DM", even some DM rooms where the other part has left ages ago) get marked as unread, even though they don’t contain any new message. Other clients don’t show any "unread" marker either for those rooms.

I cannot find any common factor for those unread markers: in some of them I’m the last one to speak, but not all of them. The "read" marker with my name is at the last message, some rooms has no reaction or event that could have landed inbetween.

However the list of "unread" rooms seems to be consistent : if I mark everything as read, quit and rerun iam, then the exact(-ish?) same list of room will get marked as unread.

I don’t know what to do to debug, if I can be of any help to figure out what’s wrong

mordquist commented 4 months ago

I've got the same experience as you and have started looking at it but don't have a complete picture of the problem yet. The function responsible for marking rooms as unread is located here.

I have noticed problems with incorrectly marked rooms when:

Other possible issues I've not looked in to are threaded vs unthreaded and private receipts.

freswa commented 2 months ago

I've got the same behavior and a lot of warnings in the logs that read like this:

2024-07-31T10:39:56.591601Z  WARN iamb::worker: Failed to set read receipt: the server returned an error: [403 / M_FORBIDDEN] You don't have permission to access that event. room_id="!xxxxxxxxxxxxx:matrix.org"