The max_id, since_id, and min_id parameters in #Mastodon's Timeline API assume that the post ID is a sortable number. (Is this correct?) #Hollo, the #ActivityPub implementation I'm building, uses UUIDs for post IDs internally, so I'm stuck on how to implement a Mastodon-compatible API.
Conversation
Notices
-
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:33:45 JST 洪 民憙 (Hong Minhee) -
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:37:04 JST 洪 民憙 (Hong Minhee) Is it time for me to start using UUIDv7?
-
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:38:51 JST 洪 民憙 (Hong Minhee) @thisismissem Okay, I guess I'll need to try UUIDv7 then!
-
Embed this notice
Emelia 👸🏻 (thisismissem@hachyderm.io)'s status on Tuesday, 14-May-2024 16:38:52 JST Emelia 👸🏻 @hongminhee yeah, Mastodon uses time-ordered ID values, by using Twitter's Snowflake algorithm.
-
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:40:18 JST 洪 民憙 (Hong Minhee) @julian According to @thisismissem, Mastodon uses Snowflake for ID generation.
-
Embed this notice
Julian Fietkau (julian@fietkau.social)'s status on Tuesday, 14-May-2024 16:40:19 JST Julian Fietkau @hongminhee Does it assume that? I don't see it clearly stated in the documentation that the IDs themselves need to be numerically sortable, just that, when given a specific ID, the server needs to be able to retrieve newer or older posts based on it.
Of course sortable snowflake IDs make implementing this easier on the server side.
-
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:46:34 JST 洪 民憙 (Hong Minhee) @thisismissem Oh, I hadn't noticed that Mastodon's Timeline API comes with a Link header. Thanks for pointing that out!
-
Embed this notice
Emelia 👸🏻 (thisismissem@hachyderm.io)'s status on Tuesday, 14-May-2024 16:46:35 JST Emelia 👸🏻 @hongminhee @julian keep in mind, you can totally not implement those parameters though, as it's all based on the next/prev Link headers, not URL construction necessarily
The only case is if clients for some reason try to make requests explicitly by constructing URLs instead of relying on headers
-
Embed this notice
Emelia 👸🏻 (thisismissem@hachyderm.io)'s status on Tuesday, 14-May-2024 16:46:36 JST Emelia 👸🏻 @hongminhee @julian correct, those parameters just say "newer / older than this ID", so you totally could fetch the object from the database and using like created at timestamps, but time-ordered unique IDs simplifies that for feeds & pagination by ID/cursor
-
Embed this notice
dansup (dansup@mastodon.social)'s status on Tuesday, 14-May-2024 16:52:34 JST dansup @thisismissem @hongminhee Yup!
https://github.com/pixelfed/pixelfed-rn/blob/main/src/lib/api.js#L35
-
Embed this notice
Emelia 👸🏻 (thisismissem@hachyderm.io)'s status on Tuesday, 14-May-2024 16:52:35 JST Emelia 👸🏻 @hongminhee yup, if memory serves, that's how dansup side-stepped this in Pixelfed
-
Embed this notice
洪 民憙 (Hong Minhee) (hongminhee@todon.eu)'s status on Tuesday, 14-May-2024 16:59:46 JST 洪 民憙 (Hong Minhee) @6d03 Apparently finalized as RFC 9562?
https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7
-
Embed this notice
Björn Gohla (6d03@mathstodon.xyz)'s status on Tuesday, 14-May-2024 16:59:47 JST Björn Gohla @hongminhee Did they finalize the RFC yet?
-
Embed this notice