fix: assertTopic incorrectly creating new id if passed-in id did not match the actual object's id

This commit is contained in:
Julian Lam
2024-02-08 11:33:27 -05:00
parent 944de4ea26
commit f1b8f3fe4f

View File

@@ -62,6 +62,12 @@ Notes.getParentChain = async (uid, input) => {
} }
} else { } else {
let object = await activitypub.get('uid', uid, id); let object = await activitypub.get('uid', uid, id);
// Handle incorrect id passed in
if (id !== object.id) {
return await traverse(uid, object.id);
}
object = await activitypub.mocks.post(object); object = await activitypub.mocks.post(object);
if (object) { if (object) {
chain.add(object); chain.add(object);