-
Notifications
You must be signed in to change notification settings - Fork 5
Auto-refresh timeline #74
base: main
Are you sure you want to change the base?
Auto-refresh timeline #74
Conversation
Uses timeouts and last post ID to get newer posts. Note: We added some overlap on Twitter in Cawbird 1 because of eventual consistency and missed tweets, but we can't assume that here, plus adding overlap results in duplicate posts
* Separate out features required for new/old into a new classes * Refactor "pull with anchor" methods for passing min/max ID * Add "load older on scroll" based on Cawbird 1 code
Timeout is an interval timeout, not a one-shot! Adding a new one each call gives an exponentially growing number of calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some good things in here, but I need to request a few changes:
- I think
ExpandableCollection
should be merged intoCollection
. The only collection that wouldn't usepull_old_posts
would beThread
, so I would rather split this ofCollection
if neccessary. - Automatically pulling for updates should be done in the backend, with
CollectionView
only activating it. - Mastodon has an proper Streaming API, so we might want to use that for updates.
I have to admit, I only just now looked at the docs, and it seems like we could only stream the
Since I would want to take a look at notifications, I would say I take care of updating |
Wouldn't that result in Thread re-implementing some of the collection behaviour? Or extending
I think I was trying to avoid having the backend set up unexpected requests. But I can probably rework it so that it doesn't make the regular requests by default and starts & stops the stream or polling.
I hadn't thought to look for the streaming API! I can probably find a way to map that into the API so that we support both streaming and polling, in case we ever end up with a Twitter-like API without streaming. |
Yes, splitting out
I think it would work to have an Boolean property like |
Just a heads-up, since it might affect this PR: |
I'm looking in to this again after all of the changes on collections. I may have found a problem with streaming and Vala:
And from the docs: "This method is not directly available to language bindings." "not directly available" suggests it might be indirectly available. but I bet it isn't 😐 Maybe this is why Baedert moved the stream processing to C? |
I saw Tooth mentioned when looking at other posts tagged #Vala. So I had a look at what they're doing. It looks like they're going completely different, avoiding librest for the stream and going all the way to web sockets! https://github.com/GeopJr/Tooth/blob/main/src/Services/Network/Streams.vala#L47 Not quite sure how it's doing the authentication, though. |
Some structural changes and timeouts to give us auto-updating timelines that poll for new messages every two minutes.
Also implements the "load older on scroll back" behaviour.
I'm not sure of the balance between "file per class" and "minor extension classes just go in the same file", so I can refactor if there's a preference.