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

Commit

Permalink
Send read marker updates immediately after moving visually
Browse files Browse the repository at this point in the history
The `TimelinePanel` uses two timers to coordinate read marker and read receipt
updates. When the read receipt timer fires, we advance the receipt and send the
latest state of both your receipt and marker to the server. When the read marker
timer fires, we advance the marker visually, but do not send anything to the
server: we were relying on the slightly different schedule of the read receipt
to actually send the updated read marker. This means there's a time window where
it's possible to visually advance the read marker without ever sending it to the
server (if you change rooms before the receipt timer fires again).

To simplify the behaviour here and ensure we always commit the updated marker
when we move it, this change sends an update to the server at the same time as
moving the marker.

It's possible this may improve some of the behaviour reported in element-hq/element-web#12338.
  • Loading branch information
jryans committed Jun 12, 2020
1 parent f98f045 commit b2733fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/structures/TimelinePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ const TimelinePanel = createReactClass({
readMarkerVisible: false,
});
}

// Send the updated read marker to the server
this.sendReadReceipt();
},


Expand Down

0 comments on commit b2733fb

Please sign in to comment.