Skip to content

fix(msg): mark deleted conversation messages instead of showing them as live - #151

Merged
gnapse merged 2 commits into
mainfrom
fix/deleted-messages
Dec 4, 2026
Merged

gnapse merged 2 commits into
mainfrom
fix/deleted-messages

Conversation

@gnapse

@gnapse gnapse commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

What

Deleted conversation messages now show as deleted, like deleted comments since #143.

  • Text: (deleted) after the header, and "This message was deleted." in place of -.
  • --json / --ndjson / --full: content: null and deleted: true.

Why

The API keeps a deleted message in place with content: "-" and deleted: true. SDK 6.3.0 stripped deleted, so the CLI showed - as a live message. todoist/comms-sdk-typescript#172 (released in 6.3.1) keeps the flag. This PR bumps to 6.3.1 and uses it.

How

Comments and messages share three helpers in src/lib/output.ts: deletedBadge, renderEntryBody, clearDeletedContent. comment view and thread view now use renderEntryBody too. Their output is unchanged.

Evidence

  • New tests in msg.test.ts and conversation.test.ts fail with the view changes reverted (2 failed), pass with them.
  • Real read-only output on a deleted DM: msg view shows (deleted) and the note. conversation view --json around it gives content: null, deleted: true, and no "-" content in 25 messages.
  • npm run verify passed.

Not verified: Node 24/26 (CI covers it).

@gnapse gnapse added the 🙋 Ask PR requires passing checks and independent human review before merge. label Dec 4, 2026
…as live

Bump @todoist/comms-sdk to 6.3.1, which keeps the message's deleted flag.
msg view and conversation view now show a (deleted) badge and a note,
and JSON output has content: null and deleted: true. The comment and
message paths share deletedBadge, renderEntryBody and clearDeletedContent.
@gnapse
gnapse force-pushed the fix/deleted-messages branch from 66af6ed to 985fdd5 Compare December 4, 2026 17:10

@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 update unifies deleted conversation message handling with comments across text and JSON output using shared helpers in src/lib/output.ts.

Few things worth tightening:

  • Load renderMarkdown lazily inside renderEntryBody rather than via a static import in src/lib/output.ts to keep the startup-latency gate intact for commands that don't render markdown.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (2)
  • P3 src/lib/output.ts:39: renderEntryBody is a new shared helper in src/lib/, but the output.ts entry in CODEBASE.md only lists formatJson/formatError/colors/pluralize/closedThreadBadge/pinnedBadge. Add renderEntryBody (and deletedBadge/clearDeletedContent, which are also missing) to that catalog line so the file's helper list stays accurate.
  • P3 src/lib/output.ts:104: Adding deleted to the essential message fields puts a new field in the --json / --ndjson contract for msg view and conversation view (previously dropped from non---full output). The repo's command-surface check treats additive --json fields as a feat: change, and CONTRIBUTING reserves minor versions for new features, but this PR is titled fix(msg): … — so semantic-release will ship the new field as a patch and leave it out of the feature notes. Retitle to feat(msg): … if the field is meant to be surfaced in the release.

Share Feedback • Review Logs • Trace

Comment thread src/lib/output.ts Resolved
@gnapse

gnapse commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

On the two optional notes:

  • CODEBASE.md catalog: fixed in 2a3eff0. The output.ts line now lists deletedBadge, renderEntryBody and clearDeletedContent.
  • fix vs feat title: keeping fix. The command-surface check lists additive --json fields in a feat: PR as fine. It does not require feat for them. This PR fixes output that showed deleted messages as live. The deleted field is how that fix shows up in --json. fix(comment): mark deleted comments instead of showing them as live #143 did the same for comments under fix(comment), so this keeps the two consistent.

@gnapse
gnapse merged commit 84056f3 into main Dec 4, 2026
6 checks passed
@gnapse
gnapse deleted the fix/deleted-messages branch December 4, 2026 17:56
doist-release-bot Bot added a commit that referenced this pull request Dec 4, 2026
## [6.1.1](v6.1.0...v6.1.1) (2026-12-04)

### Bug Fixes

* **msg:** mark deleted conversation messages instead of showing them as live ([#151](#151)) ([84056f3](84056f3))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.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

🙋 Ask PR requires passing checks and independent human review before merge. released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants