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
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
The comment docs explain general things around the pagination tokens well but when I was confronted with s2633508_17_338_6732159_1082514_541479_274711_265584_1, it wasn't obvious to me how to decipher it. I knew the stream_ordering (s2633508) part but it was really fuzzy what the other numbers were and the comment docs don't explain that part. I only really figured it out while drafting this issue and looking at the code more.
Thank you for collecting this information. Adding some contextual information about this under the Development -> Internal Documentation section of the docs website would be useful! These tokens are used in several places, so it may be useful to have a single Paginations Token page to document them, and then having pages about other system that use them (Sync) point to this page if the reader wants to learn more about the tokens.
I am wary of duplicating content between code comments and the documentation though. If we could refine the docstrings in the code, and then point to them in the documentation with a less in-depth explanation, that may strike a good balance?
anoadragon453
added
the
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
label
Mar 28, 2022
Add developer docs to explain pagination tokens.
The comment docs explain general things around the pagination tokens well but when I was confronted with
s2633508_17_338_6732159_1082514_541479_274711_265584_1
, it wasn't obvious to me how to decipher it. I knew thestream_ordering
(s2633508
) part but it was really fuzzy what the other numbers were and the comment docs don't explain that part. I only really figured it out while drafting this issue and looking at the code more.Relevant code:
RoomStreamToken
StreamToken
Relevant endpoints:
/sync
?since
next_batch
prev_batch
/messages
?from
?to
start
end
Live tokens (
stream_ordering
)synapse/synapse/types.py
Lines 436 to 437 in 3c41d87
ex.
s2633508_17_338_6732159_1082514_541479_274711_265584_1
room_key
:s2633508
->2633508
stream_ordering
presence_key
:17
typing_key
:338
receipt_key
:6732159
account_data_key
:1082514
push_rules_key
:541479
to_device_key
:274711
device_list_key
:265584
groups_key
:1
s1_33_0_1_1_1_1_7_1
s843_0_0_0_0_0_0_0_0
Each number key are concatenated together in this order:
synapse/synapse/types.py
Lines 636 to 649 in 3c41d87
And represent the position of the various fields in the
/sync
response:Historic tokens (
topological_ordering
/depth
)synapse/synapse/types.py
Lines 437 to 439 in 3c41d87
t175-530_0_0_0_0_0_0_0_0
topological_ordering
:t175
->175
(depth
)stream_ordering
:530
presence_key
:0
typing_key
:0
receipt_key
:0
account_data_key
:0
push_rules_key
:0
to_device_key
:0
device_list_key
:0
groups_key
:0
/messages
probably because the endpoint is scoped to the room and so isdepth
topological_ordering
which is the same asdepth
in SynapseMin-position tokens
This one seems pretty well explained by the comment docs already:
ex.
m56~2.58~3.59
synapse/synapse/types.py
Lines 441 to 461 in 3c41d87
The text was updated successfully, but these errors were encountered: