-
Notifications
You must be signed in to change notification settings - Fork 92
Requirement of id in Create activity #224
Description
I started implementing ActivityPub in federation yesterday and noticed something I had not (embarrassingly) given too much thought before.
Federated (server to server) Create is supposed to have an id attached to it, as is obviously the object that was created as well. The intro (editorial draft) example for example is as follows:
{"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://social.example/alyssa/posts/a29a6843-9feb-4c74-a7f7-081b9c9201d3",
"to": ["https://chatty.example/ben/"],
"author": "https://social.example/alyssa/",
"object": {"type": "Note",
"id": "https://social.example/alyssa/posts/49e2d03d-b53a-4c4c-a95c-94a6abf45a19",
"attributedTo": "https://social.example/alyssa/",
"to": ["https://chatty.example/ben/"],
"content": "Say, did you finish reading that book I lent you?"}}
While in some use cases tracking the Create separately might make sense, for my social networking server it is a completely unnecessary extra thing. Storing the create separately not only requires the database objects but also mapping an endpoint to show the object, in case someone requests it. My server is multi-protocol, so I want to avoid protocol specific code/objects as much as possible. So I would like to do my implementation without specifying an id for the Create object.
Questions:
- What would this likely cause in interoperability with other implementations?
- How should the object look without an ID - should it be
nullor just left out? This section hints both are valid cases? - Can the
Noteid be placed as theCreateid?(as suggested below)
Edit: Clarification, I would write the library with the activity id but make it optional so the server I am working on doesn't have to create and track them.