Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/fix-chats-archive-endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@beeper/cli': patch
---

Fix `chats archive` and `chats unarchive` silently no-op'ing.

Both commands called the generic chat-update endpoint (`PATCH /v1/chats/{chatID}`
with `{ isArchived }`), which returns `200 OK` but ignores `isArchived` — so the
command reported success while the chat was never archived or unarchived. They now
call the dedicated archive endpoint (`archiveChat`: `POST /v1/chats/{chatID}/archive`
with `{ archived }`) via `client.chats.archive(chatID, { archived })`, so the chat's
archive state actually changes.
3 changes: 2 additions & 1 deletion packages/cli/src/commands/chats/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class ChatsArchive extends BeeperCommand {

const client = await createClient(flags)
const chatID = await resolveChatID(client, flags.chat, { pick: flags.pick })
await printData(await client.chats.update(chatID, { isArchived: true }), flags.json ? 'json' : 'human')
await client.chats.archive(chatID, { archived: true })
await printSuccess({ message: 'Chat archived', data: { chatID, archived: true } }, flags.json ? 'json' : 'human')
}
}
3 changes: 2 additions & 1 deletion packages/cli/src/commands/chats/unarchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class ChatsUnarchive extends BeeperCommand {

const client = await createClient(flags)
const chatID = await resolveChatID(client, flags.chat, { pick: flags.pick })
await printData(await client.chats.update(chatID, { isArchived: false }), flags.json ? 'json' : 'human')
await client.chats.archive(chatID, { archived: false })
await printSuccess({ message: 'Chat unarchived', data: { chatID, archived: false } }, flags.json ? 'json' : 'human')
}
}