Skip to content

Commit

Permalink
Warn if actor has no liked property
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Jun 24, 2024
1 parent 558eb73 commit 4310cf0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions federation/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,24 @@ export class Federation<TContextData> {
);
}
}
if (
this.#likedCallbacks != null &&
this.#likedCallbacks.dispatcher != null
) {
if (actor?.likedId == null) {
logger.warn(
"You configured a liked collection dispatcher, but the " +
"actor does not have a liked property. Set the property " +
"with Context.getLikedUri(handle).",
);
} else if (actor.likedId.href != context.getLikedUri(handle).href) {
logger.warn(
"You configured a liked collection dispatcher, but the " +
"actor's liked property does not match the liked collection " +
"URI. Set the property with Context.getLikedUri(handle).",
);
}
}
if (this.#router.has("inbox")) {
if (actor.inboxId == null) {
logger.warn(
Expand Down

0 comments on commit 4310cf0

Please sign in to comment.