infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN So 28.07.2024 18:01:47
@evan this is often not true for Collections though. there's already more than one FEP about trying to detect when collections drift out of sync. and looking outside of AP, Matrix as a protocol was founded on the idea that that syncing repos of data was their primary problem to solve, not messaging or chat
Evan Prodromou (@evan@cosocial.ca)
Föderation EN So 28.07.2024 18:08:23
@trwnh we have `updated` for that.
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN So 28.07.2024 18:14:42
@evan do you then fetch the entire Collection and page through the whole thing, though? this is inefficient. one of the advantages of an event source model is that you can get pushed updates when something changes... but if you miss an event then you're out of sync. so you need a way to get back in sync, preferably without having to fetch/page the whole thing every time some digest or timestamp changes.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN So 28.07.2024 18:26:47
@trwnh again, in theory, that sucks, but in practice, only the most recent pages are updated frequently.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN So 28.07.2024 21:24:33
@trwnh and once you find the updated page, you don't have to keep synching.
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN So 28.07.2024 21:25:52
@evan this assumes append-only with none of the old pages changing
Evan Prodromou (@evan@cosocial.ca)
Föderation EN So 28.07.2024 21:35:13
@trwnh yes, which is a correct assumption. Removals from a collection are way less common than adds, for most collections.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN So 28.07.2024 21:36:13
@trwnh for collections that aren't reverse chron, it's indeed harder but conversely those are kind of uncommon. On purpose!
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN So 28.07.2024 23:38:07
@evan removals aren't *uncommon* though, and each removal shifts the index of every item. reverse chron doesn't solve this. actually it makes it worse! you need forward chron append-only -- this is the only way to ensure old pages stay consistent. your collection basically becomes a changelog. one downside is that removed items leave behind a record that they once were included. you get this issue with any append-only structure unless you rewrite history (making it no longer append only)
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN So 28.07.2024 23:41:18
@evan what we have in current fedi is... not that. rewriting history is more common than you'd think. mastodon does it for edited posts, for example -- the outbox doesn't include the Update, it actually goes back and regenerates the Create with the edited object!
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN Mo 29.07.2024 11:29:09
@khleedril things can be forgotten, it's more of a technical decision on whether to persist in history or not to do so. you needn't keep a record of everything in perpetuity.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN Mo 29.07.2024 00:07:10
@trwnh if your pages are like "first twenty items" or "start index plus 50 items", yes. That is the worst way to do paging. Removing an item from one page should not affect other pages. Treating pages like first class objects fixes most of these problems.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN Mo 29.07.2024 02:18:44
@erincandescent @trwnh I like keeping it simple: a collection is a doubly linked list of pages, and a page is an array of items. Add items to the first page until it's at some max size, and then insert a new page at the front. Easy peazy lemon squeezy.
Evan Prodromou (@evan@cosocial.ca)
Föderation EN Mo 29.07.2024 02:26:42
@erincandescent @trwnh Anyway, I think we got way off your original point, a, which is that ActivityPub is really good for Web publishing. I disagree with your thoughts about other uses -- I especially like social games, but there's a whole chapter of my book on future applications -- but I agree that the CRUD cycle is handled pretty well.
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN Mo 29.07.2024 08:28:05
@evan @erincandescent i may have not worded myself precisely enough but i am not against other uses; what i am uneasy with is the collapse of every paradigm of communication into a one-size-fits-all application of protocols. like, it would be better to have some consistent identity layer that could be used to not only publish streams of activities, but also to do proper messaging with a predefined audience to which people can be added and removed, and also to join and participate in communities.
infinite love ⴳ (@trwnh@mastodon.social)
Föderation EN Mo 29.07.2024 08:23:13
@evan maybe the worst way but also the most useful! although i did explore statically generated pages back in 2022 (see https://socialhub.activitypub.rocks/t/stricter-specifications-for-pagination-of-collections-and-orderedcollections/2633 for that), i find that broadly speaking Collection paging benefits from being treated as a dynamic presentation layer. as a consumer, you often want the examples you cited. nevertheless it should still be possible to do static paging or ahead-of-time optimizations, as in the socialhub thread.