# ActivityPub Plugin

**URL:** https://meta.discourse.org/t/activitypub-plugin/266794
**Category:** Plugin
**Tags:** experimental, activitypub
**Created:** [May 31, 2023, 5:21pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794 "2023-05-31T17:21:52Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [May 31, 2023, 5:21pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/1 "2023-05-31T17:21:53Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Discourse ActivityPub** allows you to publish Discourse posts via [ActivityPub](https://www.w3.org/TR/activitypub/) so they can be read on services that support ActivityPub such as [Mastodon](https://joinmastodon.org/). |
| 🛠 | **Repository Link** | [GitHub - discourse/discourse-activity-pub: Adds ActivityPub support to Discourse. · GitHub](https://github.com/discourse/discourse-activity-pub) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

If you’re unfamiliar with ActivityPub start by watching this short video:

https://www.loom.com/embed/392f4594abf9401a8e6389656f626afa?sid=e8df69e6-35ee-45b8-9fc1-335a9cb30e8d

When you’re ready to get started setting up the plugin, check out our #activitypub #Documentation > Integrations topics:

- [Setting up an ActivityPub Actor](https://meta.discourse.org/t/how-to-set-up-an-activitypub-actor/314578)
- [Following an ActivityPub Actor](https://meta.discourse.org/t/how-to-follow-an-activitypub-actor/314580)
- [Publishing posts to Mastodon](https://meta.discourse.org/t/publishing-posts-to-mastodon/314609)

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 1, 2023, 12:36pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/2 "2023-06-01T12:36:37Z")

</div>

Thank you for your work here! Really looking forward to turning this on, and thanks for releasing it for testing, so that those of us with various setups can contribute at least testing in a wider set of scenarios.

As I think about when to turn this on for my site, I’m trying to think through what the “one-way doors” might be.

## Sub-categories

I have 8 top-level categories, but in addition I have 21 public sub-categories. Having to follow 29 actors to follow all public site activity seems like a lot. Additionally, it might be a surprise to users that following a category doesn’t follow the sub-categories.

If I could select an option in category ActivityPub settings for “also federate public sub-categories” I would do that. Whether to separately federate sub-categories feels like a mostly one-way door from a user point of view, I think. So if you would consider an “also federate sub-categories” option, that might inform my plans. Our default sidebar shows only the top-level categories, and the Discourse default when looking at them is all the top-level and sub-category content together, so this seems reasonably consistent with Discourse expectations.

## Federate all the things!

I think that it might be interesting to also add a site-wide setting for an ActivityPub actor that federates all public posts on a site. I would use that myself. But I don’t see that as a one-way door — I would set up category federation as soon as it was otherwise ready, even if later I was going to add an “all@” actor to federate out everything.

## Edit limitations

One of the things that is not obvious from your post is that it can be read that it is only the literal `[note]...[/note]` section that can’t be edited. For others here, what it _really_ means is that if you federate, editing is currently disabled on all posts as soon as they are federated (except for posts with a literal `[note]...[/note]` section); this message shows up only when you try to _save_ your edit:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/c/0/6c08f9685c4b68521d26f2d66bf872fd0ebb3bb3.png)

My site intentionally allows sufficiently trusted users to edit indefinitely, so I can’t turn this on without the ability to disable this control (or the control being removed because edits are federated). By way of a general example applicable beyond such trusting sites, any category with wiki-mode posts will be broken by setting up federation for that category.

I tried to delete a federated post that I had made a wiki, and got this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/b/8/db80a0d3e750b72a194e6110e1c294da889fe73e.png)

However, the post was deleted and the deletion was federated.

## Personality

It would be nice to provide a profile picture for each designated actor. In Mastodon, I just see the gray elephant picture for each category actor, and I’d love to add a little personality here. ☺

## Error logs

I have gotten two kinds of errors in my logs from the activitypub plugin so far:

```plaintext
Message (3 copies reported)

NoMethodError (undefined method `ap_type' for nil:NilClass)
(eval):7:in `_fast_attributes'
app/controllers/application_controller.rb:418:in `block in with_resolved_locale'
app/controllers/application_controller.rb:418:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:367:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

Backtrace

plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:18:in `object'
plugins/discourse-activity-pub/app/serializers/discourse_activity_pub/ap/activity_serializer.rb:18:in `_object'
plugins/discourse-activity-pub/app/serializers/discourse_activity_pub/ap/activity_serializer.rb:9:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/object.rb:50:in `json'
plugins/discourse-activity-pub/app/serializers/discourse_activity_pub/ap/collection/ordered_collection_serializer.rb:7:in `map'
plugins/discourse-activity-pub/app/serializers/discourse_activity_pub/ap/collection/ordered_collection_serializer.rb:7:in `ordered_items'
(eval):7:in `_fast_attributes'

```

```plaintext
Message

Job exception: undefined method `model' for #<DiscourseActivityPubActivity id: 2, ap_id: "https://social.makerforums.info/cf2e1e8d-83e3-447e...", ap_key: nil, ap_type: "Follow", local: nil, actor_id: 3, object_id: "1", object_type: "DiscourseActivityPubActor", summary: nil, published_at: nil, created_at: "2023-06-01 02:23:13.798564000 +0000", updated_at: "2023-06-01 02:23:13.798564000 +0000">

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activemodel-7.0.4.3/lib/active_model/attribute_methods.rb:458:in `method_missing'
/var/www/discourse/plugins/discourse-activity-pub/app/models/discourse_activity_pub_activity.rb:79:in `after_deliver'
/var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_deliver.rb:42:in `perform_request'
/var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_deliver.rb:13:in `execute'
/var/www/discourse/app/jobs/base.rb:249:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-5.0.0/lib/rails_multisite/connection_management.rb:82:in `with_connection'
/var/www/discourse/app/jobs/base.rb:236:in `block in perform'
/var/www/discourse/app/jobs/base.rb:232:in `each'
/var/www/discourse/app/jobs/base.rb:232:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.9/lib/sidekiq/processor.rb:202:in `execute_job'

```

Thanks again for your work on this!

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 1, 2023, 1:52pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/3 "2023-06-01T13:52:02Z")

</div>

I’m happy to say that the [SocialHub](https://socialhub.activitypub.rocks/t/welcome-discourse-to-the-fediverse/3274) is already running it:

… tap, tap, tap…

It should have appeared on the Fediverse by now… Looking at the logs…

Oh, there are issues with the **first try at following an actor** :

- `Job exception: undefined method `model’ for #\<DiscourseActivityPubActivity id: 2, ap\_id: “[https://ps.s10y.eu/820e6bf2-ec02-49f8-ab5e-e3cefbb](https://ps.s10y.eu/820e6bf2-ec02-49f8-ab5e-e3cefbb)…”, ap\_key: nil, ap\_type: “Follow”, local: nil, actor\_id: 4, object\_id: “2”, object\_type: “DiscourseActivityPubActor”, summary: nil, published\_at: nil, created\_at: “2023-06-01 13:30:16.131136000 +0000”, updated\_at: “2023-06-01 13:30:16.131136000 +0000”\>`
- `Job exception: undefined method `model’ for #\<DiscourseActivityPubActivity id: 8, ap\_id: “[https://mastodon.social/ce62fd77-fe03-4060-a951-79](https://mastodon.social/ce62fd77-fe03-4060-a951-79)…”, ap\_key: nil, ap\_type: “Follow”, local: nil, actor\_id: 8, object\_id: “2”, object\_type: “DiscourseActivityPubActor”, summary: nil, published\_at: nil, created\_at: “2023-06-01 13:39:14.512966000 +0000”, updated\_at: “2023-06-01 13:39:14.512966000 +0000”\>`
- `Job exception: undefined method `model’ for #\<DiscourseActivityPubActivity id: 6, ap\_id: “[https://social.coop/4236c87a-0d22-402d-8546-e37a21](https://social.coop/4236c87a-0d22-402d-8546-e37a21)…”, ap\_key: nil, ap\_type: “Follow”, local: nil, actor\_id: 6, object\_id: “2”, object\_type: “DiscourseActivityPubActor”, summary: nil, published\_at: nil, created\_at: “2023-06-01 13:38:54.493118000 +0000”, updated\_at: “2023-06-01 13:38:54.493118000 +0000”\>`

> **Here is the backtrace for the last one**
>
> ```plaintext
> ctivemodel-7.0.4.3/lib/active_model/attribute_methods.rb:458:in `method_missing'
> 
> /var/www/discourse/plugins/discourse-activity-pub/app/models/discourse_activity_pub_activity.rb:79:in `after_deliver'
> 
> /var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_deliver.rb:42:in `perform_request'
> 
> /var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_deliver.rb:13:in `execute'
> 
> /var/www/discourse/app/jobs/base.rb:249:in `block (2 levels) in perform'
> 
> rails_multisite-5.0.0/lib/rails_multisite/connection_management.rb:82:in `with_connection'
> /var/www/discourse/app/jobs/base.rb:236:in `block in perform'
> 
> /var/www/discourse/app/jobs/base.rb:232:in `each'
> 
> /var/www/discourse/app/jobs/base.rb:232:in `perform'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:202:in `execute_job'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
> 
> sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:177:in `block in invoke'
> 
> /var/www/discourse/lib/sidekiq/pausable.rb:134:in `call'
> 
> sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:179:in `block in invoke'
> 
> sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:182:in `invoke'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:169:in `block in process'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/job_retry.rb:113:in `local'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq.rb:44:in `block in <module:Sidekiq>'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:263:in `stats'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/job_logger.rb:13:in `call'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/job_retry.rb:80:in `global'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:124:in `block in dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/job_logger.rb:39:in `prepare'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:123:in `dispatch'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:168:in `process'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:78:in `process_one'
> 
> sidekiq-6.5.9/lib/sidekiq/processor.rb:68:in `run'
> 
> sidekiq-6.5.9/lib/sidekiq/component.rb:8:in `watchdog'
> 
> sidekiq-6.5.9/lib/sidekiq/component.rb:17:in `block in safe_thread'
> 
> ```

The Note does not seem to appear in my feed 😢

(feel free to move this message to a more appropriate place)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [June 1, 2023, 3:55pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/4 "2023-06-01T15:55:04Z")

</div>

> [@mcdanlj](#):
>
> It would be nice to provide a profile picture for each designated actor. In Mastodon, I just see the gray elephant picture for each category actor, and I’d love to add a little personality here.

In the long run, I agree, this should be specific per actor and configurable. But atm, the site logo _should_ be picked up. It does for me for `@feature@meta.discourse.org`:

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/5/3/153eda22934c92823e2a43f9aeba3a8cdc929bec.png)

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 1, 2023, 4:29pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/5 "2023-06-01T16:29:23Z")

</div>

> [@pmusaraj](#):
>
> But atm, the site logo _should_ be picked up. It does for me for `@feature@meta.discourse.org`:

Ok, probably this was related to one of the errors I saw, then. Site logo makes lots of sense to me.

Thinking about this… If there would be a possibility to use the category color in there it would be awesome but I don’t know whether there would be a place for that.

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 1, 2023, 5:33pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/6 "2023-06-01T17:33:01Z")

</div>

I retried and…

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/6/f/76f7490b4d613b9d94ed528638d96219c8b32b05.png)

Partly working: the note was shortened a bit too much (71 characters) from the original:

> We’ve been waiting for it: now thanks to Angus McLeod and the #pavilion team, as well as CDCK, Inc. the company behind #Discourse, the #SocialHub is now federated! You can follow @fediverse@socialhub.activitypub.rocks for general announcements, and @feps@socialhub.activitypub.rocks for Fediverse Enhancement Proposals.  
> 🤗

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [June 1, 2023, 7:11pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/7 "2023-06-01T19:11:56Z")

</div>

General recommendation:

Think on it for a few days _ **before** _ you enable Activitypub integration.  
Remember that these accounts will be listed forever within the fediverse of social networks and can create confusion if you realize the account/category name should be changed after the fact. ❤

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 1, 2023, 7:23pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/8 "2023-06-01T19:23:47Z")

</div>

I believe that in the _long_ run, it would be possible to additionally implement account movement to rename the actor for a category. It’s just more work that has to be valuable to someone willing to do the work, so I doubt it’s a short term thing. ☺ At least, I hope it comes later than other more valuable work! 😁

That doesn’t invalidate your point at all.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 2, 2023, 9:07am UTC](https://meta.discourse.org/t/activitypub-plugin/266794/10 "2023-06-02T09:07:32Z")

</div>

Thanks for the feedback guys 🙂

@hellekin This will address the exceptions you were reporting. @mcdanlj It will also address the second exception you reported (same issue).

[https://github.com/discourse/discourse-activity-pub/pull/6](https://github.com/discourse/discourse-activity-pub/pull/6)

@mcdanlj The first issue you reported is a little stranger how frequently are you seeing it? Could you possibly share more details?

> [@mcdanlj](#):
>
> So if you would consider an “also federate sub-categories” option, that might inform my plans

Thanks for the feedback on that, will definitely consider it in phase 2 of the work 👍

> [@mcdanlj](#):
>
> I think that it might be interesting to also add a site-wide setting for an ActivityPub actor that federates all public posts on a site

I think that’s probably not going to happen in phase 2, but noted 👍

> [@mcdanlj](#):
>
> For others here, what it _really_ means is that if you federate, editing is currently disabled on all posts as soon as they are federated (except for posts with a literal `[note]...[/note]` section); this message shows up only when you try to _save_ your edit

Editing is only disabled on the content of the post that makes up the Note. If you don’t use the Note tags, that’s the first 500 characters, or whatever you set `activity pub note excerpt maxlength` to. One of the things I’m definitely considering for phase 2 is to _require_ `[note][/note]` tags for a Note as I can see confusion arising out of this.

> [@mcdanlj](#):
>
> I can’t turn this on without the ability to disable this control (or the control being removed because edits are federated). By way of a general example applicable beyond such trusting sites, any category with wiki-mode posts will be broken by setting up federation for that category.

You can address this by using `[note][/note]` tags to separate the Note from the other content.

> [@mcdanlj](#):
>
> I tried to delete a federated post that I had made a wiki, and got this:

Noted! We haven’t explicitly tested this with wiki posts. I haven’t been able to reproduce your issue with deleting wiki posts so far. Can you reliably reproduce it? I’ve added some specs in this PR which are all passing for that scenario, but keen to get to the bottom of that one.

[https://github.com/discourse/discourse-activity-pub/pull/7](https://github.com/discourse/discourse-activity-pub/pull/7)

> [@hellekin](#):
>
> Partly working: the note was shortened a bit too much (71 characters) from the original:

The excerpt parsing is currently handled by the same system used by the topic excerpt parsing in Discourse (for the purposes of the topic list) which is probably why it cut out a fair chunk of that (topic list excerpts would have as well). I think we might need to use a separate parser as I can forsee this creating a few issues. Sit tight on this one; it’ll definitely be addressed in phase 2.

> [@sunjam](#):
>
> Remember that these accounts will be listed forever within the fediverse of social networks and can create confusion if you realize the account/category name should be changed after the fact.

Keep in mind that you can change the display name as much as you like and that the limitation on changing the username is not unique to this plugin. So while what you say is true, this is true for a fair chunk of the fediverse.

> **[Changeable usernames?](https://socialhub.activitypub.rocks/t/changeable-usernames/830)**
>
> It’s me and my weird edge cases again 😉 In the spec, there’s nothing that inherently prevents one from changing their username, yet the very idea of it seems to be very much opposed by most of the community — or, at least, the Mastodon team. So...

Moreover, I haven’t included the username in the Actor’s id, partly to allow for the possibility of adding the ability to change the username in the future.

> [@mcdanlj](#):
>
> it would be possible to additionally implement account movement to rename the actor for a category

The plugin’s ActivityPub data is abstracted from Discourse’s data. There’s no inherent limitation in changing the Discourse model (i.e. what category) an actor is associated with. You could even possibly associate the actor with a different _type_ of Discourse model in the future, i.e. associate an Actor you created for a category with a user instead (the relationship between Actors and Discourse models is polymorphic). Not saying these will be explicitly added as features, but more to say that there aren’t hard limitations in this respect.

In general, yes it’s worth considering what categories you want as actors, but overall this implementation has a relatively high degree of flexibility so your degree of concern should be relative to that context. I’ve explained a little more about the nature of the data flow in the plugin, which further elucidates this point, here

> **[Adding federation support to Discourse](https://socialhub.activitypub.rocks/t/adding-federation-support-to-discourse/2966/6?u=angus)**
>
> Thanks! The best way to think about the implementation is that it can support FEP-1b12 (aka the Lemmy implementation). The first version aims at an integration with Mastodon, so it doesn’t look like FEP-1b12. But that will be quite doable in...

Thanks again everyone! It’s great to have engaged users.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 2, 2023, 11:55am UTC](https://meta.discourse.org/t/activitypub-plugin/266794/11 "2023-06-02T11:55:30Z")

</div>

> [@angus](#):
>
> @mcdanlj The first issue you reported is a little stranger how frequently are you seeing it? Could you possibly share more details?

I think it was associated with deleting posts, since I deleted three test posts and there were three instances of the error.

> [@angus](#):
>
> One of the things I’m definitely considering for phase 2 is to _require_ `[note][/note]` tags for a Note as I can see confusion arising out of this.

That would make it absolutely unusable for my site. I’m not trying to use Discourse as a harder way to write posts to the fediverse than just writing them in Mastodon. Trying to force my entire community to start using `[note]...[/note]` bbcode annotations, including the frequent new site users seeking help, would be a non-starter.

> [@angus](#):
>
> You can address this by using `[note][/note]` tags to separate the Note from the other content.

No, I definitely can’t. It’s not _about_ me. It’s about my site users, who are Discourse users, not discourse/discourse-activity-pub.git users.

It’s just an edit.

Federating edits is normal. To the best of my understanding, most of the widely-used ActivityPub implementations out there have allowed edits for a long time. Mastodon was the odd hold-out among popular implementations until last year when they finally caved and allowed edits.

I recognize that edits weren’t part of the MVP release, but until it either federates edits or gives me the option to turn off making the note uneditable, I can’t turn this on for my site. I don’t know whether my use case is weird or normal, of course.

My own goal for using the ActivityPub plugin is to make it easier to follow and share content as it is being created by my community forum members using Discourse. It’s not to use Discourse as a weird uneditable post-only replacement for Mastodon. ☺

My understanding is that you do intend to eventually support federating edits, since the error message says “not currently supported” — is that right? In that case, this is all just a temporary limitation and our difference in use case are not important. But it does make me wonder about investing effort into protecting edits vs. supporting federating edits.

> [@angus](#):
>
> We haven’t explicitly tested this with wiki posts. I haven’t been able to reproduce your issue with deleting wiki posts so far. Can you reliably reproduce it?

I had forgotten to remove the `retort` plugin from my sandbox site when I removed it from my production site. Removing `retort` fixed both the weird error log and the weird error message. My mistake!

> [@angus](#):
>
> (the relationship between Actors and Discourse models is polymorphic).

Does this mean that as the plugin stands today, we could use the same actor for multiple categories? Or that the data model is very flexible and the implementation details are easy to change?

> [@angus](#):
>
> The excerpt parsing is currently handled by the same system used by the topic excerpt parsing in Discourse (for the purposes of the topic list) which is probably why it cut out a fair chunk of that (topic list excerpts would have as well). I think we might need to use a separate parser as I can forsee this creating a few issues. Sit tight on this one; it’ll definitely be addressed in phase 2.

FWIW in my use case, my preference would be to post the whole thing without any limitations. I know that’s not how others might configure it, but I think in the end I would set the max size to the same as the max size for a post on my Discourse, which is… large! ☺

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 2, 2023, 12:26pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/12 "2023-06-02T12:26:26Z")

</div>

> [@mcdanlj](#):
>
> I think it was associated with deleting posts, since I deleted three test posts and there were three instances of the error.

Gotcha, I’ll investigate further soon.

> [@mcdanlj](#):
>
> No, I definitely can’t. It’s not _about_ me. It’s about my site users, who are Discourse users, not discourse/discourse-activity-pub.git users.

Understood. My comment was more that editing non-note content is indeed possible after publication currently. You’re right that this first version is not going to be without its UX issues for general use by any user. It does support other uses quite well though, e.g. federating announcements.

> [@mcdanlj](#):
>
> My understanding is that you do intend to eventually support federating edits, since the error message says “not currently supported” — is that right? In that case, this is all just a temporary limitation and our difference in use case are not important. But it does make me wonder about investing effort into protecting edits vs. supporting federating edits.

Yes, we’ll be adding support for editing Note content post-publication in phase 2. Note that editing is currently supported prior to the note being published. When you build something like this you have to reduce the number of moving parts as much as possible.

> [@mcdanlj](#):
>
> Does this mean that as the plugin stands today, we could use the same actor for multiple categories?

No, not yet. Could you explain what you mean here a bit more? Are you thinking of having a site-wide actor or are you more thinking about the sub-category issue?

> [@mcdanlj](#):
>
> Or that the data model is very flexible and the implementation details are easy to change?

Yes, although I wouldn’t necessarily use the term “easy” 😉

> [@mcdanlj](#):
>
> FWIW in my use case, my preference would be to post the whole thing without any limitations. I know that’s not how others might configure it, but I think in the end I would set the max size to the same as the max size for a post on my Discourse, which is… large!

I’m curious where you’re anticipating federating the unrestricted content? Genuine question; I want to understand where you’re coming from a bit more here.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 2, 2023, 1:50pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/13 "2023-06-02T13:50:03Z")

</div>

> [@angus](#):
>
> Gotcha, I’ll investigate further soon.

I forgot to edit that out after discovering that my leaving `retort` in place accidentally was the source of the error. 😳

Oops.

> [@angus](#):
>
> Yes, we’ll be adding support for editing Note content post-publication in phase 2.

Good enough! 🙏

I’ll not worry about this any more, and in phase 2 I’ll help test that.

> [@angus](#):
>
> Are you thinking of having a site-wide actor or are you more thinking about the sub-category issue?

I vaguely wondered about both, but it was a low-value question. Was just curious how far I could carry my experimentation with my staging site, and didn’t want to try things that were known to be impossible already. 👍

> [@angus](#):
>
> I’m curious where you’re anticipating federating the unrestricted content? Genuine question; I want to understand where you’re coming from a bit more here.

I’ll try!

Context: Mastodon limits the length of post it will allow users to _author_ but not the length of post it will _display._ I run a Mastodon-glitch server configured with a 2000-character limit; I’ve seen several people post about configuring a 31337-character limit (because _of course_). I see long posts in my feed from folks using pleroma, akkoma, etc.

We have some really cool content showing up on Maker Forums (my discourse) from time to time (in my opinion, anyway!), and I’d like to promote it on the Fediverse generally to make it accessible to a wider audience. I know that Mastodon has been opinionated that 500 characters is the magic length for microblogging — but ActivityPub isn’t limited to microblogging. It’s federation, including but not limited to microblogging. When I follow an ActivityPub actor in my Mastodon account, it’s not limited to short posts. I can read, comment on, and boost longer posts.

So the “where you’re anticipating federating” is a confusing question to me.

- I would boost the content from my Mastodon-glitch server. Boosts do not apply the character limit that applies to authoring posts even on stock Mastodon.
- I would expect community members to follow from any ActivityPub server (recognizing this will be more Mastodon than others at least right now), and they won’t all have the same opinionated view of how long an ActivityPub note should be.

Ultimately, as the server administrator, I’m not in control of where this content is federated to. This is the decision of every _follower._ It’s not obvious to me why excepting vs federating the entire discourse post as an activitypub note would be the default even for followers on Mastodon, but more so throughout the Fediverse.

I’m not sure that answers your question. But I’m not sure I understand it well, either. 😁 Happy to dive deeper on this if you’d like.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 2, 2023, 3:11pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/14 "2023-06-02T15:11:16Z")

</div>

> [@mcdanlj](#):
>
> I forgot to edit that out after discovering that my leaving `retort` in place accidentally was the source of the error. 😳

No worries! Glad we’ve covered the exceptions for now then. Let us know if you see any more. @hellekin Likewise, let us know if you see any other issues or strange behaviour.

> [@mcdanlj](#):
>
> I’ll not worry about this any more, and in phase 2 I’ll help test that.

Great! Thank you.

> [@mcdanlj](#):
>
> I’m not sure that answers your question

It does! Thank you, it’s useful context for our planning of phase 2.

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 2, 2023, 3:17pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/15 "2023-06-02T15:17:30Z")

</div>

I’m about to upgrade to the latest version. One thing that would be useful is to choose the audience: whether the post will be public or followers-only. Now it’s the latter, so we cannot boost it, and must follow the account prior to receiving notices. I appreciate that because it remains experimental, but it should definitely be an option to post publicly so we can advertise the feature more widely to the Fedizens 🙂

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 2, 2023, 3:20pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/16 "2023-06-02T15:20:41Z")

</div>

> [@hellekin](#):
>
> One thing that would be useful is to choose the audience: whether the post will be public or followers-only

Yes, that’s something we’ll be considering in phase 2 👍

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 2, 2023, 3:32pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/17 "2023-06-02T15:32:07Z")

</div>

Do you have a public roadmap for the development phases?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 2, 2023, 3:34pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/18 "2023-06-02T15:34:49Z")

</div>

There’s no public roadmap, but I will let you know when we figure out the specifics. Any reasonable suggestions for what should be in it are welcome! Specific use case examples like @mcdanlj’s are always helpful too.

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 2, 2023, 6:58pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/19 "2023-06-02T18:58:13Z")

</div>

I made some proposals on the SocialHub that were already made here some time ago…

> **[Adding federation support to Discourse](https://socialhub.activitypub.rocks/t/adding-federation-support-to-discourse/2966/9?u=how)**
>
> My top features would be: Enable public postings — so that the Fediverse can boost announcements Enable full posting of Notes within \[note\]\[/note\] up to 500 chars Maybe add a character counter in the composer (but we can count ourselves) ...

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [June 2, 2023, 7:36pm UTC](https://meta.discourse.org/t/activitypub-plugin/266794/20 "2023-06-02T19:36:06Z")

</div>

> [@hellekin](#):
>
> One thing that would be useful is to choose the audience: whether the post will be public or followers-only. Now it’s the latter, so we cannot boost it

I hadn’t gotten to the point of noticing this yet in my testing from a staging server, but I’d like to acknowledge that boosting is central to my own use case as well.

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [June 4, 2023, 11:53am UTC](https://meta.discourse.org/t/activitypub-plugin/266794/21 "2023-06-04T11:53:34Z")

</div>

## Handling 410 Gone

My logs have a lot of (changed URL):

```plaintext
[Discourse Activity Pub] GET request to https://activitypub.example/users/missing-account failed: Expected([200, 201, 202, 301, 302, 307, 308]) <=> Actual(410 Gone)

```

I believe this is related to: Object retrieval SHOULD respond with 410 Gone status code if `Tombstone` is in response body, otherwise responds with 404 Not Found (`server:object-retrieval:deleted-object:410-status`): the account has moved to another instance.

* * *

Also getting a few:

```plaintext

[Discourse Activity Pub] update_stored_from_json failed to save actor. AR errors: Ap has already been taken. Actor JSON: {"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","toot":"http://joinmastodon.org/ns#","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"movedTo":{"@id":"as:movedTo","@type":"@id"},"schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","discoverable":"toot:discoverable","Device":"toot:Device","Ed25519Signature":"toot:Ed25519Signature","Ed25519Key":"toot:Ed25519Key","Curve25519Key":"toot:Curve25519Key","EncryptedMessage":"toot:EncryptedMessage","publicKeyBase64":"toot:publicKeyBase64","deviceId":"toot:deviceId","claim":{"@type":"@id","@id":"toot:claim"},"fingerprintKey":{"@type":"@id","@id":"toot:fingerprintKey"},"identityKey":{"@type":"@id","@id":"toot:identityKey"},"devices":{"@type":"@id","@id":"toot:devices"},"messageFranking":"toot:messageFranking","messageType":"toot:messageType","cipherText":"toot:cipherText","suspended":"toot:suspended"}],"id":"https://mas.to/users/rikvipcode","type":"Person","following":"https://mas.to/users/rikvipcode/following","followers":"https://mas.to/users/rikvipcode/followers","inbox":"https://mas.to/users/rikvipcode/inbox","outbox":"https://mas.to/users/rikvipcode/outbox","featured":"https://mas.to/users/rikvipcode/collections/featured","featuredTags":"https://mas.to/users/rikvipcode/collections/tags","preferredUsername":"rikvipcode","name":"","summary":"","url":"https://mas.to/@rikvipcode","manuallyApprovesFollowers":false,"discoverable":false,"published":"2023-05-04T00:00:00Z","devices":"https://mas.to/users/rikvipcode/collections/devices","suspended":true,"publicKey":{"id":"https://mas.to/users/rikvipcode#main-key","owner":"https://mas.to/users/rikvipcode","publicKeyPem":"--...

```

* * *

And

```plaintext
[Discourse Activity Pub] GET request to https://mastodon.social/users/ejovoni46709 failed: Expected([200, 201, 202, 301, 302, 307, 308]) <=> Actual(410 Gone)
[Discourse Activity Pub] Failed to process https://mastodon.social/users/ejovoni46709: Could not resolve actor
[Discourse Activity Pub] Failed to process https://mastodon.social/users/ejovoni46709#delete: Could not create actor
[Discourse Activity Pub] Failed to process https://mastodon.social/users/epybisezax9438#delete: Could not find object

```

[Next page](https://meta.discourse.org/t/activitypub-plugin/266794.md?page=2)
