Local echo of marking a room as read
SDK version of https://github.com/element-hq/element-x-ios/issues/4042
If you're on a bad connection or your server is slow to respond it can be frustrating to wait for receipts to come down sync to mark rooms as read. … Currently seems bad on matrix.org when receipts can take minutes to process.
Thanks! took the liberty to edit the issue name, because simulating an ephemeral event (read receipt) is much more complicated than having a local echo to mark the room as read locally.
There's little hardship in this, unless for a very specific case, where we would optimistically mark the room as read, but the request to do so failed for some reason. In that case, we should revert the state. And read receipts / other devices marking the room as read on other devices throws a wrench at us: we need to make sure that even if we revert the state, we don't revert as unread if the room would've been marked as read b/o sync events.
I think the issue should be generalized as a more generic one as multiple parts of the SDK could be a candidate to this. So far, we didn't enter that path as it can create so much conflicts and complexity… The only source of truth if the /sync, and the state of the SDK reflects what has been received by the /sync, period. We can discuss about changing that, but it's a long-term project.