Accept Public aliases in incoming ActivityPub data#6466
Accept Public aliases in incoming ActivityPub data#6466dahlia wants to merge 1 commit intoLemmyNet:mainfrom
Conversation
eb02ca2 to
f5e91c1
Compare
Normalize `Public` and `as:Public` to the canonical ActivityStreams public collection URL during recipient deserialization. Apply the helper across incoming `to` and `cc` fields in ActivityPub object and activity protocol structs so existing visibility checks accept all three spec-compliant public representations. Add regression tests for bare and prefixed public addressing, and direct unit tests for the helper's single-value and array forms. Fixes LemmyNet#6465 Assisted-by: Codex:gpt-5.4
f5e91c1 to
6aa63a8
Compare
|
@Nutomic I checked Would you mind taking a quick look and letting me know if these seem unrelated to this PR? |
|
This makes sense! But instead of making the change here in Lemmy, it would be better to change it directly in the activitypub-federation library. Then it will also benefit other projects. The test failures look unrelated, probably just random errors. |
|
At first, I also thought I could solve this issue at the |
|
Check the file I linked above. You can put the same code from your |
Replace the WARNING callout in *Making the community actor Lemmy- compatible* that previously labelled outbound `Announce(Create(Page))` as blocked by Lemmy's `object_is_not_public` check. Now that Fedify 2.2 serializes the public audience as the full `https://www.w3.org/ns/activitystreams#Public` URI (and Lemmy's upstream fix in [LemmyNet/lemmy#6466] is on the way), the community's fan-out lands in subscribers' feeds on Lemmy, and replies and votes ride the same path back. Rewritten as a NOTE with the historical context preserved so readers encountering older Fedify or Lemmy versions can still diagnose the original symptom. Also bump the `fedify --version` prerequisite from 2.1.0 to 2.2.0, since that's the release that ships the sender-side workaround this tutorial now relies on for the Lemmy walkthrough. [LemmyNet/lemmy#6466]: LemmyNet/lemmy#6466 Assisted-By: Claude Code:claude-opus-4-7
|
Following the suggestion to move this into LemmyNet/activitypub-federation-rust#165 If that PR is merged, I can update this PR to use the upstream helper instead of keeping the deserialization logic locally. |
|
Actually the easiest solution is to change this line and have it compare with other valid |
Replace the WARNING callout in *Making the community actor Lemmy- compatible* that previously labelled outbound `Announce(Create(Page))` as blocked by Lemmy's `object_is_not_public` check. Now that Fedify 2.2 serializes the public audience as the full `https://www.w3.org/ns/activitystreams#Public` URI (and Lemmy's upstream fix in [LemmyNet/lemmy#6466] is on the way), the community's fan-out lands in subscribers' feeds on Lemmy, and replies and votes ride the same path back. Rewritten as a NOTE with the historical context preserved so readers encountering older Fedify or Lemmy versions can still diagnose the original symptom. Also bump the `fedify --version` prerequisite from 2.1.0 to 2.2.0, since that's the release that ships the sender-side workaround this tutorial now relies on for the Lemmy walkthrough. [LemmyNet/lemmy#6466]: LemmyNet/lemmy#6466 Assisted-By: Claude Code:claude-opus-4-7
Fixes #6465.
ActivityPub allows the public collection to be represented as the canonical IRI,
as:Public, orPublic. As described in #6465, Lemmy only handled the canonical form on some incoming paths.This PR normalizes
Publicandas:Publicto the canonical ActivityStreams public URL when deserializing incomingtoandccrecipients. It applies that handling across incoming object and activity protocol structs, so the existing visibility checks continue to work without broader logic changes.It also adds regression tests for post parsing and visibility, plus direct unit tests for the new deserialization helper.
Note
This patch was developed with assistance from GPT-5.4. I reviewed the final changes myself, verified the behavior locally, and ran the relevant tests before opening this PR.