Skip to content

feat: add skip_truncate to channel delete - #271

Merged
mogita merged 2 commits into
mainfrom
feat/cha-5241-skip-truncate
Sep 10, 2026
Merged

feat: add skip_truncate to channel delete#271
mogita merged 2 commits into
mainfrom
feat/cha-5241-skip-truncate

Conversation

@mogita

@mogita mogita commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Ticket

CHA-5241

Problem

Soft deleting a channel also truncates it, so a channel recreated with the same id comes back empty and replies quoting older messages fail. The API gained a skip_truncate option that keeps the history, and neither delete request can send it.

Solution

ChannelDeleteRequest.setSkipTruncate(boolean) sends skip_truncate as a query param on DELETE /channels/{type}/{id}, and ChannelDeleteManyRequest.setSkipTruncate(boolean) sends it in the channels/delete body. Both fields are Boolean and omitted when unset, so existing calls send the same request as before.

The server owns the rules: skip_truncate is rejected together with a hard delete, and only distinct channels are eligible.

How to verify

  1. ./gradlew test --tests '*ChannelDeleteSkipTruncateTest*' passes (4 tests, no API credentials needed). They assert the query param is on the built request URL when set and absent when null, and that the batch body carries the field only when set.
  2. ./gradlew spotlessCheck passes.

🤖 Generated with Claude Code

mogita and others added 2 commits September 9, 2026 14:40
Soft deleting a channel truncates it, so a channel recreated with the same id comes back empty. ChannelDeleteRequest and ChannelDeleteManyRequest take setSkipTruncate, sent as a query param on the single delete and a body field on the batch delete, both omitted when unset.

Co-Authored-By: Claude Opus 5 <[email protected]>
Adding skip_truncate to the existing method changed a public interface signature. Keep it and add a three argument overload beside it, so callers of ChannelService.delete(type, id) still compile.

Co-Authored-By: Claude Opus 5 <[email protected]>
@mogita
mogita merged commit 4bdab76 into main Sep 10, 2026
5 checks passed
@mogita
mogita deleted the feat/cha-5241-skip-truncate branch September 10, 2026 11:44
@github-actions github-actions Bot mentioned this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants