Skip to content

Simplify message ordering and server-side sorting - #183

Open
stevebauman wants to merge 6 commits into
v2.0from
feature/v2-message-sorting
Open

Simplify message ordering and server-side sorting#183
stevebauman wants to merge 6 commits into
v2.0from
feature/v2-message-sorting

Conversation

@stevebauman

@stevebauman stevebauman commented Sep 1, 2026

Copy link
Copy Markdown
Member

Message queries currently blur together local UID ordering and RFC 5256 server-side sorting. They also expose oldest() and newest(), even though UID order does not reliably represent message chronology.

This replaces that API with two explicit operations: orderByUid() for capability-free local UID ordering, and sortBy() for server-side sorting. The query stores one UidOrder or ImapSort strategy, making the two modes mutually exclusive without maintaining or resetting parallel properties.

Repeated sortBy() calls add RFC 5256 criteria in priority order, allowing later criteria to act as tie-breakers. Hydrated FETCH responses are rebuilt in the original SORT order, extended SORT capabilities are recognized, and the testing fake applies the same ordering strategies. Server-side sorting continues to fail clearly when the mailbox does not advertise a SORT capability.

@stevebauman stevebauman changed the title Simplify the message sorting API Simplify message ordering and server-side sorting Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant