pachli-android
pachli-android copied to clipboard
support read marker API
Is your feature request related to a problem? Please describe. From my understanding supporting the Read Marker API, would allow to keep reading position in sync across devices, which I find a highly compelling feature.
Describe the solution you'd like Support Read Marker API: https://github.com/mastodon/mastodon/pull/11762
Describe alternatives you've considered Remembering reading position is already supported, but the position is remembered per client and not per account.
I haven't found a way to do this (except for notifications) that isn't surprising in some way to the user.
The problems are roughly as follows.
1. The Mastodon marker API only works for the home timeline and notifications.
So no support for restoring the position for favourites, bookmarks, the local or federated timelines, lists, etc.
Notifications and posts are (if you squint a bit) definitely different things. But it's not immediately obvious that a post on the home timeline is different from the same post appearing in those other timelines.
So scrolling your home timeline in Pachli could have that be reflected in the web app, or vice versa, but not in a list, or the local timeline, or wherever else. Which is pretty strange UX.
2. The Mastodon web UI doesn't place nicely with the marker API.
The Mastodon web UI updates the marker position quite frequently -- if you leave the page open it will stream in new posts and update the markers as it does so for example. Or when you scroll.
But it only fetches the home timeline marker once, when the page is first loaded.
So if you have Pachli and the web app open at the same time, and are scrolling in Pachli the web app is not going to notice that unless you explicitly reload the page.
And if you have scrolled in Pachli there's a chance that the web app will stream in a new post and update the marker position that Pachli saved with a marker position that's different to your current reading position in Pachli.
It's not clear what Pachli should do in that situation:
- Ignore the marker?
- Jump to the new position?
- Overwrite the marker?
- Something else?
For example, suppose you open the web app and you see 10 posts (10 through 1, where 10 is the newest, 1 is the oldest). You leave the web app open and lock your screen.
You open Pachli and you see those same 10 posts. You refresh in Pachli and another 5 posts have arrived (15 through 11). You read up, so your reading position in Pachli is now at post 15. You switch away from Pachli and do something else on your device.
The web app is still running on your locked computer. It streams in the new posts, but your reading position there hasn't changed, so it resets the marker back to post 10.
You re-open Pachli. Your last reading position in Pachli was 15, the marker says 10.
Jumping back to post 10 in this scenario is not what the user wants.
In the API markers are supposed to be versioned to provide some locking functionality, but I can't see that this is actually used in the web UI (I may have missed something).
3. Can only detect marker updates through polling
There's no mechanism for the server to inform the client "The marker for timeline X has changed, here's the new value", the client has to periodically poll for it. As noted the web UI doesn't do this, it assumes it's the only thing managing the marker.
Pachli could poll for the marker changes, but this is additional network traffic (keeping the device's radios on for longer, which is a bettery drain), and per item 2 it's still not clear what Pachli should do if it detects the marker has changed.