You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to support permalinks in the (UI) timeline of the Rust SDK, that is, the ability to click a link to an event, and navigate around it (in the past and future, i.e. backwards- and forward- paginate).
We do have some support for backwards pagination already in the event cache, so there's some previous work here. Here's how I see the next steps:
add support for arbitrary pagination in the event cache, backwards- or forward-
retrieve the initial data, given an initial event id, using the /context endpoint
then allow stateful pagination using a paginator kind of API. Paginating forward in the timeline would return whether we've reached the end of the timeline, at which point the caller may change the focus back to Live.
(edge case) handle forged event ids not resolving to an actual event (transform 404 into a proper error)
(bugfix + nice to have) fix date separator insertion by using a post-processing pass instead of inserting in an ad-hoc manner. This may avoid future headaches when working on forward pagination, or insertion at random spots in the timeline.
(nice to have) when clicking a permalink to an event that's "close by" (TBD), don't switch focus, but prepend events (until the focused event - N events)
(nice to have) another focus mode that's "latest unread" (= read marker)
(nice to have) make the paginator stateful object able to read events from the cache before spawning server queries
(nice to have, but not mandatory for this to happen) reconcile events received from a pagination with cached events.
Subsets of the problem to consider: no overlap (easy; throw away/keep in memory until there's some overlap after keeping on paginating), complete overlap (easy; do nothing — maybe replace pagination tokens), partial overlaps (intractable in the worst cases: what if we know A/B/C and receive A/D/C, as there's no way to figure the relative position of B and D — easy if there's linear overlap, aka A/B/C is known and we receive A/B/C/D or D/A/B/C).
The text was updated successfully, but these errors were encountered:
This introduces a new helper object to run arbitrary pagination requests, backwards- or forward-. At the moment they're disconnected from the event cache, although I've put the files there for future convenience, since at some point we'll want to merge the retrieved events with the cache (? maybe).
This little state machine makes it possible to retrieve the initial data, given an initial event id, using the /context endpoint; then allow stateful pagination using a paginator kind of API. Paginating in the timeline indicates whether we've reached the start/end of the timeline.
The test for the state subscription is quite extensive and makes sure the basic functionality works as intended.
Some testing helpers have been (re)introduced in the SDK crate, simplifying the code, and introducing a better `EventFactory` / `EventBuilder` pattern than the existing one in the `matrix-sdk-test` crate. In particular, this can make use of some types in `matrix-sdk`, notably `SyncTimelineEvent` and `TimelineEvent`, and I've found the API to be simpler to use as well.
Part of #3234.
We want to support permalinks in the (UI) timeline of the Rust SDK, that is, the ability to click a link to an event, and navigate around it (in the past and future, i.e. backwards- and forward- paginate).
We do have some support for backwards pagination already in the event cache, so there's some previous work here. Here's how I see the next steps:
/context
endpointLive
.Paginator
API #3309Part of #3058
Nice to have (deferred)
The text was updated successfully, but these errors were encountered: