Follow

question:

When you receive an Add activity into the inbox for a paged collection you don't control, how do you know whether or not to split off a new page in that collection? It doesn't seem like Collections know their own page size...

@cwebber @kaniini

@jdormit @kaniini I generate the collection pages dynamically from a datastructure pointed to from the collection uri internally

@cwebber @kaniini

Ah, so you don't differentiate between paged and unpaged in your data model? Do you just return a paged collection for all collections past a certain size?

@jdormit @kaniini What I've done is generate paged collections Very Dynamically, so something like:

example.org/col/<collection-uu
example.org/col/<collection-uu<first-post-of-page-uri>

So the first link is to the collection, which of course links to the latest page at the time of generation
The second link's query parameter points at the first item from this page you'd like (assuming it is indeed in the collection) then gives the N (eg 20) items in the page. Then link to then next one!

@cwebber I really like the id of the page query param pointing to a specific item id and just returning the next N items. Elegant way of expressing dynamic paging.

@jdormit @cwebber That's how I do paging at rhiaro.co.uk too. Internally everything is stored as AS2 collections and then 16-item pages are dynamically generated, eg. rhiaro.co.uk/tags/activitypub? and secret feature, you can add &limit=x to the URL to change the page size. It works with conneg to application/activity+json too if you curl it

@jdormit @cwebber unless the way the collection is ordered has no relation to the id itself.

@jdormit I think that you shouldn't really allow activity submissions on a paged collection. In my opinion the client/server adding the activity should dereference the parent collection IRI (from the partOf property) and submit it there.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!

We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot Café list of blocked instances. Ash is the admin and is supported by Fuzzface and Brian! as moderators.

Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!