Query paging for masked email and archived items #297

Merged
jcoffey-dev merged 2 commits from fix/query-pagination-296 into main 2026-11-06 07:08:38 +00:00
Owner

Fixes #296.

x:MaskedEmail/query and x:ArchivedItem/query both called extract_parameters(.., Some(Property::Id)) and dropped what it returned. With a position past the first page and calculateTotal off, that call takes position, anchor and limit off the request for a storage-level page, so QueryResponseBuilder never saw them: the reply started from the first item again and ignored limit. Both methods filter and sort in memory, so they now pass None and leave paging to the builder. RFC 8620 §5.5 paging works as specified on both.

Commits

  • Stefan's patch from #296, under his name: the masked email fix and masked_email_query_pagination. Thanks Stefan.
  • The same fix for archived items. The undelete test now pages through the archive one item at a time. Its standalone runner also turns on directory queries, as system_tests does: test 14 shares with an account it has no other connection to, which #283 refuses with the setting off, so undelete_tests alone has failed at share_inbox since #283.

The other callers (log, report, spam_sample, the registry query) use the returned parameters, so they're unaffected.

Tested (RocksDB, one test at a time)

  • masked_email_query_pagination, masked_email_tests and undelete_tests pass.
  • With the archived item fix reverted, undelete_tests fails at the new check: the page at position 1 returns all three items.
  • cargo fmt --check, cargo build -p inbuxa --locked, cargo test --workspace --locked --no-run and the fork checks are clean.
Fixes #296. `x:MaskedEmail/query` and `x:ArchivedItem/query` both called `extract_parameters(.., Some(Property::Id))` and dropped what it returned. With a `position` past the first page and `calculateTotal` off, that call takes `position`, `anchor` and `limit` off the request for a storage-level page, so `QueryResponseBuilder` never saw them: the reply started from the first item again and ignored `limit`. Both methods filter and sort in memory, so they now pass `None` and leave paging to the builder. RFC 8620 §5.5 paging works as specified on both. **Commits** - Stefan's patch from #296, under his name: the masked email fix and `masked_email_query_pagination`. Thanks Stefan. - The same fix for archived items. The undelete test now pages through the archive one item at a time. Its standalone runner also turns on directory queries, as `system_tests` does: test 14 shares with an account it has no other connection to, which #283 refuses with the setting off, so `undelete_tests` alone has failed at `share_inbox` since #283. The other callers (`log`, `report`, `spam_sample`, the registry query) use the returned parameters, so they're unaffected. **Tested** (RocksDB, one test at a time) - `masked_email_query_pagination`, `masked_email_tests` and `undelete_tests` pass. - With the archived item fix reverted, `undelete_tests` fails at the new check: the page at position 1 returns all three items. - `cargo fmt --check`, `cargo build -p inbuxa --locked`, `cargo test --workspace --locked --no-run` and the fork checks are clean.
jcoffey-dev added 2 commits 2026-11-06 06:56:47 +00:00
Leave pagination parameters on the request for QueryResponseBuilder instead of extracting them for storage-level pagination. Add a focused masked-email query regression covering successive positions and duplicate page results.
Archived item query pagination, as for masked email
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 11m46s
b96e2c5948
x:ArchivedItem/query took position, anchor and limit off the request for
a storage-level page it never used, so the response builder started from
the first item every time: a page past the first repeated the first page
and ignored limit. The items are filtered and sorted in memory, so leave
the parameters for the builder, as the masked email query now does.

The undelete test now pages through the archive one item at a time, and
its standalone runner turns on directory queries, as system_tests does:
test 14 shares with an account it has no other connection to, which #283
refuses with the setting off.
jcoffey-dev merged commit 3a0a117ce9 into main 2026-11-06 07:08:38 +00:00
jcoffey-dev deleted branch fix/query-pagination-296 2026-11-06 07:08:39 +00:00
Sign in to join this conversation.