mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-02 01:45:52 +02:00
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>