From 7b838ea2958ab2b261f1fefb73e040df9435ffab Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 22 Mar 2026 21:03:49 +0100 Subject: [PATCH] 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 --- lib/mastodon/routes/statuses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/routes/statuses.js b/lib/mastodon/routes/statuses.js index 64fcb41..0aa119f 100644 --- a/lib/mastodon/routes/statuses.js +++ b/lib/mastodon/routes/statuses.js @@ -339,7 +339,7 @@ router.post("/api/v1/statuses", async (req, res, next) => { }; try { - await addTimelineItem(collections.ap_timeline, timelineItem); + await addTimelineItem(collections, timelineItem); } catch (storeError) { console.warn("[Mastodon API] Failed to store outbound DM in timeline:", storeError.message); }