refactor: ♻️ Add URI Collections and change all appropriate Collections to use them

This commit is contained in:
Jesse Wierzbinski 2024-11-03 12:19:21 +01:00
parent 3babd7a5a3
commit b59b6b8ebb
No known key found for this signature in database
8 changed files with 71 additions and 12 deletions

View file

@ -102,7 +102,7 @@ Extensions **may** choose to register their own interaction types (such as `pub.
Implementations that find a user attempting to create an interaction they are not allowed to **MUST** return a `403 Forbidden` HTTP status code when processing the Note during federation. The Note **must** also be discarded.
It is important for implementations to backfill any related [Collections](/structures/collection) (e.g. user followers) in order to not incorrectly reject Notes based off of outdated data.
It is important for implementations to backfill any related [Collections](/structures/collection)/[URI Collections](/structures/collection#uri-collection) (e.g. user followers) in order to not incorrectly reject Notes based off of outdated data.
<Note>
To avoid server load from constant Collection refreshing, implementations **could** only refetch associated Collections when forbidden interactions are detected, then recalculate permissions again.

View file

@ -92,8 +92,8 @@ To undo a like or dislike, a [Delete](/entities/delete) entity should be used. T
The Likes extension adds the following collections to the [User](/entities/user) entity:
- `likes`: A [Collection](/structures/collection) of all the notes the user has liked.
- `dislikes`: A [Collection](/structures/collection) of all the notes the user has disliked.
- `likes`: A [URI Collection](/structures/collection#uri-collection) of all the notes the user has liked.
- `dislikes`: A [URI Collection](/structures/collection#uri-collection) of all the notes the user has disliked.
```jsonc
{

View file

@ -58,7 +58,7 @@ The Reactions Extension extends the [Note](/entities/note) entity with the follo
<Col>
<Properties>
<Property name="reactions" type="array" required>
URI to a [Collection](/structures/collection) of the [Reactions](#entity-definition) attached to the note.
URI to a [URI Collection](/structures/collection#uri-collection) of the [Reactions](#entity-definition) attached to the note.
</Property>
</Properties>
</Col>