fix: resolveLocalId to return null values instead of throwing for no resolution

This commit is contained in:
Julian Lam
2024-02-09 11:15:03 -05:00
parent ac56289fa2
commit 11dba85d0a
2 changed files with 10 additions and 4 deletions

View File

@@ -53,6 +53,12 @@ Notes.getParentChain = async (uid, input) => {
const chain = new Set();
const traverse = async (uid, id) => {
// Handle remote reference to local post
const { type, id: localId } = await activitypub.helpers.resolveLocalId(id);
if (type === 'post' && localId) {
return traverse(uid, localId);
}
const exists = await db.exists(`post:${id}`);
if (exists) {
const postData = await posts.getPostData(id);