Skip to content

Always clear unread status in room and send read receipt when using "Mark as read" feature #25611

@MadLittleMods

Description

@MadLittleMods

Your use case

What would you like to do?

Always clear unread status in room and send read receipt when using "Mark as read" feature

Why would you like to do it?

The "Mark as read" features are not reliable and can often have no effect leaving your room still as unread.

(whether pressing escape or using the "Mark as unread" option)

How would you like to achieve it?

Make the clearRoomNotification(...) logic robust:

  • Always choose the latest event
    • The logic around the latest event is obviously flawed because it uses event timestamps (untrusted and there so many race conditions where your perfectly accurate timestamp event can be behind or in front of another). It needs to use the latest event according to the DAG
    • lastThread has the same timestamp based flaws
    • Do we really not have access to a unthreaded timeline where we can just grab the latest event from /sync and /messages?
  • If it's a decision between two events, just send receipts for both anyway
  • Even if the app already believes it sent a receipt and is caught up, just send it again
  • Add feedback when an error occurs
  • Clearing notification counts as a last ditch effort without sending the receipts to back that up is just a recipe to have the unreads appear after refresh.

Have you considered any alternatives?

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions