Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S2S Add/Remove language implies doing nothing #407

Open
trwnh opened this issue Jan 1, 2024 · 6 comments
Open

S2S Add/Remove language implies doing nothing #407

trwnh opened this issue Jan 1, 2024 · 6 comments
Assignees
Labels
Needs FEP Needs a FEP Next version Normative change, requires new version of spec

Comments

@trwnh
Copy link

trwnh commented Jan 1, 2024

The following language is contained in both C2S and S2S Add/Remove:

  • the target is not owned by the receiving server, and thus they can't update it.
  • the object is not allowed to be added/removed to the target collection for some other reason, at the receiver's discretion.

This language makes sense for C2S, where the "receiving server" / "receiver" are authoritative owners of the collection. It prevents situations where you Add or Remove to someone else's collection. However, for S2S, you may receive an Add/Remove that notifies you of a change from the authoritative server, and this Add/Remove necessarily will not be owned by you -- it is owned by the sender instead. ActivityPub results in delivery for all addressed actors in to/cc/audience.

Example:

  • I Add an object to my collection via C2S. The receiving server (my server) validates it.
  • My server then sends the Add to my followers (on other servers).
  • The other servers receive an Add targeting a collection they do not own, and thus "do nothing" with it, since the first bullet point prevents them from doing anything if taken at face value.

Should there be expanded language describing such cases and what to do in these cases? Instead, the language for S2S Create is more appropriate:

the activity should appear in the actor's inbox and it is likely that the server will want to locally store a representation of this activity and its accompanying object. However, this mostly happens in general with processing activities delivered to an inbox anyway.

Just replace "object" with "target", as the local representation will most likely end up cached anyway.

Summary of proposed errata / guidance

Current language:

Upon receipt of an Add activity into the inbox, the server SHOULD add the object to the collection specified in the target property, unless:

  • the target is not owned by the receiving server, and thus they can't update it.
  • the object is not allowed to be added to the target collection for some other reason, at the receiver's discretion.

Proposed language:

Upon receipt of an Add activity into the inbox, it is likely that the server will want to locally store a representation of the activity's object within the local representation of the activity's target. The server SHOULD do this unless:

  • the target is not owned by the sending server, and thus they can't update it.
  • the object is not allowed to be added to the target collection for some other reason, at the receiver's discretion.

Ditto for Remove.

@evanp
Copy link
Collaborator

evanp commented Jan 3, 2024

This is an important discussion. I added the following two pages to the primer to document better how to handle Add and Remove:

I agree that noting that Add and Remove are largely noops would be helpful, but I am not convinced that the text of the specification is incorrect or misleading.

@trwnh
Copy link
Author

trwnh commented Jan 3, 2024

As discussed during issue triage, the collection being managed may in fact be on a different server than the actor of the activity. This leads to three possible cases:

  • Actor on sending server, Collection on sending server
    • C2S has side effects, S2S is noop
  • Actor on sending server, Collection on receiving server
    • C2S is noop, S2S has side effects
  • Actor on sending server, Collection on third-party server
    • C2S is noop, S2S is noop

Modifying a local representation (cache) is something that could be mentioned as in S2S Create, but if it doesn't rise to the level of errata then that's fine with me. I'm fine with closing this issue as resolved for the most part.

The interesting thing, I think, is the idea that delivery happens on the C2S side anyway, despite it being a noop. That is, if the C2S receiving server receives an activity targeting a collection on another server, then it should still handle delivery.

@nightpool
Copy link
Collaborator

nightpool commented Jan 3, 2024 via email

@evanp
Copy link
Collaborator

evanp commented Oct 4, 2024

So, revisiting this topic, we seem to have a consensus to make an erratum to clarify the text. We don't have exact wording now, but we are going to tag this with "Needs erratum" and come back to it.

@evanp evanp added Needs errata We need to add errata for this and removed Needs Group Input/Decision Waiting for Commenter labels Oct 4, 2024
@evanp
Copy link
Collaborator

evanp commented Oct 4, 2024

It's also worth considering that we might want to make synching collections easier in a future version. Re-fetching a large collection is a big cost in the network, and using Add/Remove/Update/... as a means to synch collections would really lower that cost.

@evanp evanp added the Needs FEP Needs a FEP label Dec 13, 2024
Copy link

This issue has been labelled as potentially needing a FEP, and contributors are welcome to submit a FEP on the topic.
Note that issues may be closed without the FEP being created; that does not mean that the FEP is no longer needed.

@evanp evanp added Next version Normative change, requires new version of spec and removed Needs errata We need to add errata for this labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs FEP Needs a FEP Next version Normative change, requires new version of spec
Projects
None yet
Development

No branches or pull requests

3 participants