Follow

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.

Well, Mastodon itself just fetches without max_id when it refreshes so it will just get latest stuff and might keep some deleted stuff in timeilne in case there was a disconnect or there's no streaming I think?

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. github.com/nolanlawson/pinafor

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.

Sign in to participate in the conversation
birb site

This is a tiny, friendly fedi server!