Files
multica/server/cmd
Naiyuan Qing 05113b9a98 feat(inbox): add cursor pagination + per-issue dedup at SQL level
Adds ListInboxItemsLatest / ListInboxItemsBefore with DISTINCT ON
(COALESCE(issue_id, id)) so an issue with multiple unarchived
notifications collapses to a single row at the database, and rewrites
ListInbox to dual-route on ?limit/?before. Old desktop clients (no
params) get a capped legacy []InboxItemResponse — this branch is
permanent because users may never auto-update — while new clients get
the {entries, next_cursor, has_more} wrapper. CountUnreadInbox now
COUNTs DISTINCT to keep the badge aligned with the listing.

A partial composite index (workspace_id, recipient_type, recipient_id,
created_at DESC, id DESC) WHERE archived = false backs the keyset
pagination as an index-only scan.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 16:21:03 +08:00
..