store: paginate Inbox / Outbox / MessagesWithPeer #4
Labels
No labels
needs-triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
arne/msg#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
store.SQLite.Inbox()andstore.SQLite.Outbox()return all rows with no LIMIT.MessagesWithPeeris similarly unbounded. This is fine while the database is small but scales linearly with retention; a daemon running for a year on a busy URL will eventually load O(N) rows into the TUI's memory each refresh tick.Proposal
before_id/after_idpaging parameters on the read methods, with the TUI requesting newer pages on scroll.Schema-side this needs no change — the existing
messages.idprimary key is the natural cursor.Acceptance criteria
(limit int, beforeID int64)or equivalent.[?).limitrows.Context
Surfaced in the v1.0.0 self-review. Defer until the daemon has accumulated enough history that it actually matters; the schema is already paging-friendly so this is a pure read-side change.