mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
fix: broadcastActorUpdate was silently failing due to Fedify API mismatch
ctx.getActor() only exists on RequestContext (inside HTTP handlers), not on the base Context returned by createContext(). Extracted actor-building logic into shared buildPersonActor() helper used by both the dispatcher and broadcastActorUpdate(). Profile link attachments now propagate to remote instances via Update(Person) activity.
This commit is contained in:
14
index.js
14
index.js
@@ -1,6 +1,6 @@
|
||||
import express from "express";
|
||||
|
||||
import { setupFederation } from "./lib/federation-setup.js";
|
||||
import { setupFederation, buildPersonActor } from "./lib/federation-setup.js";
|
||||
import {
|
||||
createFedifyMiddleware,
|
||||
} from "./lib/federation-bridge.js";
|
||||
@@ -690,9 +690,15 @@ export default class ActivityPubEndpoint {
|
||||
{ handle, publicationUrl: this._publicationUrl },
|
||||
);
|
||||
|
||||
// Retrieve the full actor from the dispatcher (same object remote
|
||||
// servers will get when they re-fetch the actor URL)
|
||||
const actor = await ctx.getActor(handle);
|
||||
// Build the full actor object (same as what the dispatcher serves).
|
||||
// Note: ctx.getActor() only exists on RequestContext, not the base
|
||||
// Context returned by createContext(), so we use the shared helper.
|
||||
const actor = await buildPersonActor(
|
||||
ctx,
|
||||
handle,
|
||||
this._collections,
|
||||
this.options.actorType,
|
||||
);
|
||||
if (!actor) {
|
||||
console.warn("[ActivityPub] broadcastActorUpdate: could not build actor");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user