Skip to content

fix: bump @todoist/comms-sdk to 6.0.0 - #125

Merged
rfgamaral merged 3 commits into
mainfrom
ricardo/bump-comms-sdk-6
Nov 18, 2026
Merged

rfgamaral merged 3 commits into
mainfrom
ricardo/bump-comms-sdk-6

Conversation

@rfgamaral

@rfgamaral rfgamaral commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

🗺 Overview

Bump @todoist/comms-sdk from 5.2.2 to 6.0.0.

comms/remove and conversation_messages/remove return the deleted entity instead of { "status": "ok" }. The old SDK parsed that response as a status and threw a ZodError after the delete had already happened, so tdc comment delete --yes and tdc msg delete --yes removed the item and then exited 1. SDK 6.0.0 resolves deleteComment and deleteMessage on any 2xx without reading the body.

No code changes are needed: both commands only await the call and never read its result.

🔗 Reference

🧪 Test plan

Delete a comment

  1. Run tdc comment delete <comment-ref> --yes for a comment you created
    • Observe that it prints Comment <id> deleted.
    • Observe that the exit code is 0

Delete a message

  1. Run tdc msg delete <message-ref> --yes for a message you sent in a conversation
    • Observe that it prints Message <id> deleted.
    • Observe that the exit code is 0

`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
@rfgamaral rfgamaral added the 👀 Show PR requires passing checks before merge and independent human review before or after merge. label Nov 18, 2026
@rfgamaral rfgamaral self-assigned this Nov 18, 2026

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ZodError never reaches them.
  • A test using the real-SDK pattern already in thread.test.ts (a customFetch returning 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 or npm run verify result in the description.

Share Feedback • Review Logs • Trace

Comment thread package.json Resolved
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
@rfgamaral

Copy link
Copy Markdown
Member Author

@doistbot /review

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
  • P3 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.

Share Feedback • Review Logs • Trace

Move the fake 200 response into mockJsonFetch so the thread, comment and
msg tests no longer each carry their own copy.
@rfgamaral
rfgamaral requested a review from pawelgrimm November 18, 2026 11:45
@rfgamaral
rfgamaral merged commit 5b00d3c into main Nov 18, 2026
6 checks passed
@rfgamaral
rfgamaral deleted the ricardo/bump-comms-sdk-6 branch November 18, 2026 11:46
doist-release-bot Bot added a commit that referenced this pull request Nov 18, 2026
## [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))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR requires passing checks before merge and independent human review before or after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tdc comment delete exits 1 after a successful delete

2 participants