fix: bulk_edit_raindrops update/move/remove all 404 on wrong path param key - #52
Open
sebWarembourg wants to merge 1 commit into
Open
fix: bulk_edit_raindrops update/move/remove all 404 on wrong path param key#52sebWarembourg wants to merge 1 commit into
sebWarembourg wants to merge 1 commit into
Conversation
batchUpdateBookmarksInCollection and batchDeleteBookmarksInCollection call
PUT/DELETE /raindrops/{collectionId} but pass params.path.id instead of
params.path.collectionId. openapi-fetch substitutes path tokens by exact
key match, so {collectionId} in the URL template is never replaced and the
request 404s against Raindrop's API. bulk_edit_raindrops therefore fails
100% of the time on operation=update and operation=remove.
batchUpdateBookmarks (used for operation=move) calls PUT /raindrops with
no collectionId segment at all -- not a valid Raindrop endpoint -- so move
404s too. Give it an optional collectionId param and hit
/raindrops/{collectionId} like the other batch methods, defaulting to 0
(all collections) when the caller doesn't pass one.
Also wire collectionId through bookmark_manage's single-item update path
(it accepted the field but silently dropped it, so it could tag a bookmark
but never move it between collections).
Verified against the live Raindrop API: update (tag), move, and remove all
return 200 with the expected result after the fix; same requests 404
before it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bulk_edit_raindropsfails 100% of the time on all three operations (update,move,remove). Found this while running a real batch (54 bookmarks) through an MCP client.Root cause
batchUpdateBookmarksInCollectionandbatchDeleteBookmarksInCollectioncallPUT/DELETE /raindrops/{collectionId}but passparams.path.idinstead ofparams.path.collectionId:openapi-fetchsubstitutes path tokens by exact key match against the literal{token}in the path string you pass at the call site. Since the string says{collectionId}and the key supplied isid, no substitution happens — the request goes out with the literal, unsubstituted{collectionId}segment and Raindrop's API 404s on it. (The generated type for this operation is misleadingly named{ id: number }, which is presumably how theidkey crept in — but the runtime template only cares about the string literal, so it still needsas anyto satisfy the type.)batchUpdateBookmarks(used foroperation: "move") has a related but separate bug: it callsPUT /raindropswith no collection segment at all, which isn't a valid Raindrop endpoint — 404 as well.Separately,
bookmark_manage's single-itemupdatehandler acceptscollectionIdin its input schema but never reads it when building the update payload, so it can tag a bookmark but never move it between collections.Fix
collectionIdin both batch methods.batchUpdateBookmarksan optionalcollectionIdparam (defaults to0, i.e. all collections) and route it through/raindrops/{collectionId}like the other batch methods; pass the tool'sargs.collectionIdthrough frombulk_edit_raindrops'smovehandler.bookmark_manage'scollectionIdontocollection: { $id }in the single-item update payload.Testing
tsc --noEmitandbun run buildpass.bun run test: same 8 pre-existing failures on this branch as on unmodifiedmaster(all due to missingRAINDROP_ACCESS_TOKEN/live-API tests in this sandbox, unrelated to this change) — no regressions.update(tag),move, andremoveall return200with the expectedresult/matched/modifiedafter the fix; the pre-fix shapes reproducibly 404 on the same account.