Repository navigation
fix: bump @todoist/comms-sdk to 6.0.0 - #125
Conversation
`tdc comment delete` and `tdc msg delete` deleted the item and then exited
1 with a ZodError. The API now returns the deleted entity instead of
`{ "status": "ok" }`, and the old SDK failed to parse it. SDK 6.0.0
resolves delete calls on any 2xx without reading the body.
Fixes #113
doistbot
left a comment
There was a problem hiding this comment.
Bumps @todoist/comms-sdk from 5.2.2 to 6.0.0 so delete endpoints resolve on any 2xx instead of throwing a ZodError on the new deleted-entity response body; the comment delete and msg delete handlers only await the call, so no code changes are needed and package.json/lockfile stay consistent.
Few things worth tightening:
- The PR's claim that delete commands now exit 0 isn't pinned anywhere in the repo: the existing delete tests mock the SDK client, so they pass identically on 5.2.2 and 6.0.0 and the fixed
ZodErrornever reaches them. - A test using the real-SDK pattern already in
thread.test.ts(acustomFetchreturning the deleted comment/message body) would fail on 5.2.2 and pass on 6.0.0 — the fail-before/pass-after proof the definition of done asks for; alternatively, report the actual command output ornpm run verifyresult in the description.
Run comment delete and msg delete through CommsApi with a customFetch answering with the deleted entity, so they fail on @todoist/comms-sdk 5.2.2 and pass on 6.0.0. Refs #113
|
@doistbot /review |
doistbot
left a comment
There was a problem hiding this comment.
This PR bumps @todoist/comms-sdk from 5.2.2 to 6.0.0 so comment and message deletes no longer throw a ZodError after the delete succeeds. The version change is clean — manifest and lockfile agree — and the new regression tests in comment.test.ts and msg.test.ts exercise the real SDK through a customFetch returning the deleted-entity body, giving exactly the fail-before/pass-after evidence the earlier review asked for. The tests line up with the handlers (mocked getComment/getMessage and getSessionUser make the delete the only HTTP call) and follow the established thread.test.ts pattern. No inline issues were flagged. Two non-blocking notes for whenever it's convenient: the fake-Response literal for customFetch is now duplicated across three test files and could move into a shared helper, and the summary should note that test execution/npm run verify and live API behavior weren't part of this pass.
I also left one optional follow-up note in the details below.
Optional follow-up note (1)
src/commands/comment/comment.test.ts:249: This ~10-line fake-Response literal (ok/status/statusText/headers/text/json) is copied verbatim into msg.test.ts:109 and already exists inline in thread.test.ts:412. Since this diff adds two more copies, a tiny shared helper (e.g. in src/lib/fixtures or a colocated test util) like
mockFetchResponse(body)would keep future changes to the mock shape in one place. Fine to defer if you'd rather match the existing inline pattern for now.
Move the fake 200 response into mockJsonFetch so the thread, comment and msg tests no longer each carry their own copy.
## [5.1.1](v5.1.0...v5.1.1) (2026-11-18) ### Bug Fixes * bump @todoist/comms-sdk to 6.0.0 ([#125](#125)) ([5b00d3c](5b00d3c))
|
🎉 This PR is included in version 5.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🗺 Overview
Bump
@todoist/comms-sdkfrom5.2.2to6.0.0.comms/removeandconversation_messages/removereturn the deleted entity instead of{ "status": "ok" }. The old SDK parsed that response as a status and threw aZodErrorafter the delete had already happened, sotdc comment delete --yesandtdc msg delete --yesremoved the item and then exited 1. SDK6.0.0resolvesdeleteCommentanddeleteMessageon any 2xx without reading the body.No code changes are needed: both commands only
awaitthe call and never read its result.🔗 Reference
🧪 Test plan
Delete a comment
tdc comment delete <comment-ref> --yesfor a comment you createdComment <id> deleted.0Delete a message
tdc msg delete <message-ref> --yesfor a message you sent in a conversationMessage <id> deleted.0