Masto app developers!
How do you refresh current timeline?
For a long time we used a trick where we took top post id, incremented ID by one and expected that top post to be returned back but it doesn't seem to actually work, you need to increment by some much bigger number.
Would love to hear from you.
After being offline @pinafore will also just fetch posts newer than the top (with since_id) and also won't refresh current ones.
@dumpsterqueer @charlag Pinafore doesn't have a way to actually refresh the entire timeline (it's a TODO), but for streaming in new statuses, we actually work backwards from the most recent toots, fetching batches using max_id, until we reach the top post ID. https://github.com/nolanlawson/pinafore/blob/b241ea18ac2bb44ab56cf3da0a68c0cd3bd0e767/src/routes/_actions/stream/fillStreamingGap.js
There's also a bunch of logic in the client to avoid showing duplicates, so we don't have to care much about double-fetching.
@charlag Yeah Pinafore doesn't make a huge effort to try to figure out if locally-cached statuses have been deleted or not. If we get the delete event from streaming, great. If not, then if the user tries to click on the status they will see the 404 at that point.
@pinafore it still does better than Mastodon I think which doesn't even cover gaps properly as far as I know.
The API is just not designed to play well with caching.
@charlag Well for the Favorites timeline I just gave up on caching entirely and just always fetch from the network, because of how the IDs work.
Now there's also the thing that saves your place in a timeline, and persists your unread notifications count to the server, but I haven't updated to that yet.
This is a tiny, friendly fedi server!