fix: #14185, assert note if Like received to a post that doesn't already exist

This commit is contained in:
Julian Lam
2026-04-17 13:32:49 -04:00
parent 01a2283cc3
commit 48bf54b948

View File

@@ -338,9 +338,16 @@ inbox.like = async (req) => {
exists = await posts.exists(_id);
id = _id;
}
} else {
exists = await posts.exists(object.id);
if (!exists) {
// Proactively pull in the note
const asserted = await activitypub.notes.assert(0, object.id, { skipChecks: 1 });
if (!asserted) {
throw new Error('[[error:invalid-pid]]');
}
exists = true;
}
id = object.id;
}
if (!id || !exists) {