fix(mastodon-api): pass collections object (not raw collection) to addTimelineItem

addTimelineItem(collections, item) destructures { ap_timeline } from its
first argument. Passing collections.ap_timeline directly gave it a raw
MongoDB collection with no ap_timeline property, causing
"Cannot read properties of undefined (reading 'updateOne')".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-22 21:03:49 +01:00
parent 481603391e
commit 7b838ea295
+1 -1
View File
@@ -339,7 +339,7 @@ router.post("/api/v1/statuses", async (req, res, next) => {
}; };
try { try {
await addTimelineItem(collections.ap_timeline, timelineItem); await addTimelineItem(collections, timelineItem);
} catch (storeError) { } catch (storeError) {
console.warn("[Mastodon API] Failed to store outbound DM in timeline:", storeError.message); console.warn("[Mastodon API] Failed to store outbound DM in timeline:", storeError.message);
} }