fix: filter the pile on chat flags and fetch snippets from the message index

Verified against Beeper Desktop 4.3.73 with a real token:

- inbox=primary combined with unreadOnly=true returned 0 of 78 genuinely
  unread chats, and includeMuted=false returned muted chats anyway. Both
  params are gone; muted/archived/low-priority are now decided here from
  isMuted/isArchived/isLowPriority, and a hand-marked-unread chat counts.
- Snippets now come from GET /v1/messages/search (1.1 ms/chat) instead of
  GET /v1/chats/{id}/messages (145 ms/chat), which is kept as the fallback
  for chats the index has not reached. list --limit 50 went 3.33s -> 0.16s.
This commit is contained in:
prdlk committed 2026-09-01 11:45:09 -04:00
1 parent 11624ce59c
commit 56b8c73fd1
5 files changed
+180 -51

No files matched your search

+7 -1
View File
@@ -16,7 +16,13 @@ First release.
- Paging with `n`/`p`, page size 1–50, poll interval 15–3600 s.
- `bin/omarchy-beeper` CLI: `list`, `read`, `read-all`, `open`, `auth`. Every
command prints one JSON object and exits 0.
- Muted, archived, and low-priority chats are excluded from the pile.
- Muted, archived, and low-priority chats are excluded from the pile, filtered
on each chat's own flags: Beeper Desktop 4.3.73 ignores `includeMuted=false`
and `inbox=primary` hides genuinely unread chats when combined with
`unreadOnly=true`.
- Row snippets come from `GET /v1/messages/search` (~1 ms per chat) with
`GET /v1/chats/{chatID}/messages` as the fallback for chats the message
index has not reached yet, and only for the rows on screen.
- Token stored at `~/.config/omarchy-beeper/secrets/token.json` (600, in a 700
directory), read with `O_NOFOLLOW`, never passed in argv.
- All HTTP bound to `http://localhost:23373/v1/`, no redirects, 2 MiB body cap