Could you explain your thinking here a bit more? What do you gain by getting rid of the Activities? Whatâs the benefit of moving in this direction?
The PR adding this functionality is not yet merged, so Iâll give you a final version when it is, but itâll look something like this
Example Collection JSON
{
"id": "https://angus.eu.ngrok.io/ap/collection/07530bbc3e0e87b2766f82132b010c10",
"type": "OrderedCollection",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"url": "https://localhost/t/this-is-a-new-topic/11",
"totalItems": 3,
"summary": "This is a new topic",
"orderedItems": [{
"id": "https://angus.eu.ngrok.io/ap/activity/767fb780785bd91b608733801ee25817",
"type": "Announce",
"to": "https://www.w3.org/ns/activitystreams#Public",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"type": "Group",
"updated": "2023-08-07T14:42:47Z",
"url": "https://localhost/c/general/4",
"inbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/followers",
"preferredUsername": "general",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz4D/UcTsgVdAo6lWu/8Y\nhjLIaisqADAZaY0ALd0LV6nlo8vMBw+sqsC5iB//Gl+reH1GiXwJIGV2L04dW1wt\nvw0Z8Y+lZKjP0uYxaR28hNvYnTegt3u18U/DyuopGRm16O+pO+nKGKm/sirfxELK\nvPzFfipWMpPyWeZfjvll7HpScMkmMQi+JXdA2sbeNUzUiMvVYKVfIGZCGASNOImp\nbnNce8Y+xmrbA2C04MB4pULeHffIEdq5NlugA56Gg7/p9whG96jC28Zwh3K9EJvp\nAeU4kYO5etBSTI6185ONHxcmaFtoqYB00c6HMSaXhv9AMVnC0EjvpuJKnt34tIWJ\nLQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "http://localhost:3000/images/discourse-logo-sketch-small.png"
},
"name": "General",
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/activity/6c33b55799e5d819bb25c44c4eb6acda",
"type": "Create",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"type": "Person",
"updated": "2023-08-07T14:43:49Z",
"url": "http://localhost:3000/u/angus",
"inbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/followers",
"preferredUsername": "angus",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuNyL3+e/Bjl/jUS6F4KG\nB3dLIbxIEczNzSC2mjYi6HEfdptFvEI7SoSZAM7SKSK8eB5THhpQbEvYZQxRxzJQ\ncANZ2kEHe7qsFLHJeUOX9y7cHf20nnEkCiqw7sKI901d28vrzoe9QMw19I6EWGIQ\nOyIlXOF0EPTM8wDkH9NmdK7IbjY+6F7wLNEUYSVZPhKryoMzf7FHkzzOQ5Zoe0LE\nUzjCIbxMFVLLo4osKiNfOuBEGswyIkg/Fos6opQJ4Pp8QJ9opWh6zmjgJW7wHVan\nd3SiiQkOZNsHWVxPgQf4npU5pr/AxYGMwmJU5NTVk05iRq6XVuhc/K6oATxoYCrY\neQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "//localhost:3000/user_avatar/localhost/angus/96/3_2.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/object/0fdbe2f67c115951ae2d55236b5ff409",
"type": "Note",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"url": "https://localhost/t/this-is-a-new-topic/11/3",
"content": "This is the third post.<br><br><a href=\"https://localhost/t/this-is-a-new-topic/11/3\">Discuss this on our forum.</a>",
"inReplyTo": "https://angus.eu.ngrok.io/ap/object/17aaf4a5e50be8a7d2f181b0490e6502",
"@context": "https://www.w3.org/ns/activitystreams"
}
}
},
{
"id": "https://angus.eu.ngrok.io/ap/activity/b5594c545d8b6418fbcedf5a65a5dc32",
"type": "Announce",
"to": "https://www.w3.org/ns/activitystreams#Public",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"type": "Group",
"updated": "2023-08-07T14:42:47Z",
"url": "https://localhost/c/general/4",
"inbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/followers",
"preferredUsername": "general",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz4D/UcTsgVdAo6lWu/8Y\nhjLIaisqADAZaY0ALd0LV6nlo8vMBw+sqsC5iB//Gl+reH1GiXwJIGV2L04dW1wt\nvw0Z8Y+lZKjP0uYxaR28hNvYnTegt3u18U/DyuopGRm16O+pO+nKGKm/sirfxELK\nvPzFfipWMpPyWeZfjvll7HpScMkmMQi+JXdA2sbeNUzUiMvVYKVfIGZCGASNOImp\nbnNce8Y+xmrbA2C04MB4pULeHffIEdq5NlugA56Gg7/p9whG96jC28Zwh3K9EJvp\nAeU4kYO5etBSTI6185ONHxcmaFtoqYB00c6HMSaXhv9AMVnC0EjvpuJKnt34tIWJ\nLQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "http://localhost:3000/images/discourse-logo-sketch-small.png"
},
"name": "General",
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/activity/ddf3611f5a0c23fda0693f77897631b2",
"type": "Create",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"type": "Person",
"updated": "2023-08-07T14:43:49Z",
"url": "http://localhost:3000/u/angus",
"inbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/followers",
"preferredUsername": "angus",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuNyL3+e/Bjl/jUS6F4KG\nB3dLIbxIEczNzSC2mjYi6HEfdptFvEI7SoSZAM7SKSK8eB5THhpQbEvYZQxRxzJQ\ncANZ2kEHe7qsFLHJeUOX9y7cHf20nnEkCiqw7sKI901d28vrzoe9QMw19I6EWGIQ\nOyIlXOF0EPTM8wDkH9NmdK7IbjY+6F7wLNEUYSVZPhKryoMzf7FHkzzOQ5Zoe0LE\nUzjCIbxMFVLLo4osKiNfOuBEGswyIkg/Fos6opQJ4Pp8QJ9opWh6zmjgJW7wHVan\nd3SiiQkOZNsHWVxPgQf4npU5pr/AxYGMwmJU5NTVk05iRq6XVuhc/K6oATxoYCrY\neQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "//localhost:3000/user_avatar/localhost/angus/96/3_2.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/object/1f2d7bfb76b711103b38338ada94b7f0",
"type": "Note",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"url": "https://localhost/t/this-is-a-new-topic/11/2",
"content": "This is the second post.<br><br><a href=\"https://localhost/t/this-is-a-new-topic/11/2\">Discuss this on our forum.</a>",
"inReplyTo": "https://angus.eu.ngrok.io/ap/object/17aaf4a5e50be8a7d2f181b0490e6502",
"@context": "https://www.w3.org/ns/activitystreams"
}
}
},
{
"id": "https://angus.eu.ngrok.io/ap/activity/0fe5ae348ca9747c01a5639b5af28884",
"type": "Announce",
"to": "https://www.w3.org/ns/activitystreams#Public",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"type": "Group",
"updated": "2023-08-07T14:42:47Z",
"url": "https://localhost/c/general/4",
"inbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe/followers",
"preferredUsername": "general",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/f1647a8c356030d99861bf8910bb6dbe",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz4D/UcTsgVdAo6lWu/8Y\nhjLIaisqADAZaY0ALd0LV6nlo8vMBw+sqsC5iB//Gl+reH1GiXwJIGV2L04dW1wt\nvw0Z8Y+lZKjP0uYxaR28hNvYnTegt3u18U/DyuopGRm16O+pO+nKGKm/sirfxELK\nvPzFfipWMpPyWeZfjvll7HpScMkmMQi+JXdA2sbeNUzUiMvVYKVfIGZCGASNOImp\nbnNce8Y+xmrbA2C04MB4pULeHffIEdq5NlugA56Gg7/p9whG96jC28Zwh3K9EJvp\nAeU4kYO5etBSTI6185ONHxcmaFtoqYB00c6HMSaXhv9AMVnC0EjvpuJKnt34tIWJ\nLQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "http://localhost:3000/images/discourse-logo-sketch-small.png"
},
"name": "General",
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/activity/a41210d107cc00c54f5f613c248cdc9d",
"type": "Create",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"actor": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"type": "Person",
"updated": "2023-08-07T14:43:49Z",
"url": "http://localhost:3000/u/angus",
"inbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/inbox",
"outbox": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/outbox",
"followers": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199/followers",
"preferredUsername": "angus",
"publicKey": {
"id": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199#main-key",
"owner": "https://angus.eu.ngrok.io/ap/actor/429132f80a0cef25d1864c07fc5b7199",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuNyL3+e/Bjl/jUS6F4KG\nB3dLIbxIEczNzSC2mjYi6HEfdptFvEI7SoSZAM7SKSK8eB5THhpQbEvYZQxRxzJQ\ncANZ2kEHe7qsFLHJeUOX9y7cHf20nnEkCiqw7sKI901d28vrzoe9QMw19I6EWGIQ\nOyIlXOF0EPTM8wDkH9NmdK7IbjY+6F7wLNEUYSVZPhKryoMzf7FHkzzOQ5Zoe0LE\nUzjCIbxMFVLLo4osKiNfOuBEGswyIkg/Fos6opQJ4Pp8QJ9opWh6zmjgJW7wHVan\nd3SiiQkOZNsHWVxPgQf4npU5pr/AxYGMwmJU5NTVk05iRq6XVuhc/K6oATxoYCrY\neQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "//localhost:3000/user_avatar/localhost/angus/96/3_2.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
},
"@context": "https://www.w3.org/ns/activitystreams",
"object": {
"id": "https://angus.eu.ngrok.io/ap/object/17aaf4a5e50be8a7d2f181b0490e6502",
"type": "Note",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": "2023-08-08T08:38:51Z",
"updated": "2023-08-08T08:38:51Z",
"url": "https://localhost/t/this-is-a-new-topic/11/1",
"content": "This is the first post.<br><br><a href=\"https://localhost/t/this-is-a-new-topic/11/1\">Discuss this on our forum.</a>",
"@context": "https://www.w3.org/ns/activitystreams"
}
}
}
],
"@context": "https://www.w3.org/ns/activitystreams"
}
We are currently publishing an OrderedCollection when a topic is first created, yes. This is partly because we allow a few minutes delay between when a topic is first created and the first activities are published. A few posts can be added to the topic in that time window. Rather than schedule multiple publications, we publish all the activities performed in the initial window at once.
Publishing a collection has the added benefit of publishing topic metadata the same time (e.g. a topic tile is a summary
on the collection), so itâs quite conceivable you could, say, federate between two Discourse categories (that wonât work in the first version of this, but itâll be possible to do with this approach).
Could you explain your thinking a bit more? it seems quite intentional. The service processing incoming activities in the inbox is the ProcessCollectionService which handles various types of collections.
Announcing an activity works quite well with Mastodon. Indeed FEP-1b12 would probably need another approach if it didnât.