feat(endpoint-microsub): PR 1 - Core Microsub server with channels and timeline - #829
feat(endpoint-microsub): PR 1 - Core Microsub server with channels and timeline#829rmdes wants to merge 6 commits into
Conversation
c50cd1e to
ee6ae94
Compare
a556cc4 to
4bbc622
Compare
ee6ae94 to
ae01604
Compare
|
Hi @rmdes. Firstly, sorry it’s taken me so long to get back to you on this; life got in the way. I should hopefully now have some time to review/collaborate on this feature. I’ve pushed two extra commits:
Before merging this into
Thanks again for your patience, looking forward to getting this contribution into Indiekit! |
d04ba60 to
8dfa381
Compare
…imeline This PR adds the foundational Microsub endpoint with: **Microsub API:** - GET/POST ?action=channels - list, create, update, delete, reorder channels - GET/POST ?action=timeline - list items, mark read/unread, remove **Storage:** - MongoDB collections for channels and items - Cursor-based pagination for timeline - Per-user channel ordering and read state tracking **Features:** - Follows Microsub spec for channel and timeline actions - Testable with existing Microsub clients (Monocle, Indigenous, etc.) - Multi-user support via userId from session/token This is PR 1 of 6 for the Microsub implementation. Future PRs will add: - PR 2: Feed discovery and subscription - PR 3: Feed fetching and parsing - PR 4: Reader UI - PR 5: Compose and Micropub integration - PR 6: Settings and filtering Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8dfa381 to
5e0b783
Compare
The plug-in declared mongodb ^6.0.0 while indiekit declares ^7.4.0, so npm installed a nested copy of the driver. ObjectId values created by the plug-in came from bson 6 but were passed to collections served by bson 7, which threw BSONVersionError in markItemsRead, markItemsUnread and removeItems.
Fixes unicorn/prefer-await, unicorn/prefer-number-coercion, unicorn/consistent-boolean-name, unicorn/no-computed-property-existence-check and jsdoc/reject-function-type, and removes unused eslint-disable directives. Satisfying unicorn/prefer-await means init() now awaits index creation rather than leaving it to run in the background, so plug-in initialisation waits for indexes to be created. Errors are still caught and warned about, and the plug-in loader already awaits init().
Unit tests cover lib/utils and lib/storage, mirroring the structure of lib/. Controllers are covered by integration tests, as in other endpoint plug-ins.
|
Thanks @paulrobertlloyd, and no problem about the delay. I’ve pushed three commits covering both points, plus one fix that writing the tests uncovered. Two things are worth calling out, as neither is obvious from the diff.
|
Summary
This PR adds the foundational Microsub endpoint with channel and timeline management.
What's included
Microsub API:
GET/POST ?action=channels- list, create, update, delete, reorder channelsGET/POST ?action=timeline- list items, mark read/unread, removeStorage:
Features:
How to test
/microsubendpointPR breakdown
This is PR 1 of 6 for the Microsub implementation:
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com