Repository navigation
fix(databases): bound offset and limit for transaction-aware listing - #14964
Conversation
Transaction reads merge stored rows with staged writes in memory, so the fetch window grows with the offset. Cap offset plus limit at APP_LIMIT_COUNT and point callers at cursor pagination.
|
Something went wrong while processing your review. Our team has been automatically notified and is investigating the issue. We'll reach out as soon as we have updates. In the meantime, you can retry by tagging @tenki-reviewer. Sorry for the inconvenience. |
🟢 Tier S · Ready to merge
Transaction-aware plain document listing now rejects requests whose offset plus limit exceeds
📂 Walkthrough · 2
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
Review complete. No issues found — approved ✅. This small change bounds the in-memory window built when paging through a transaction's uncommitted (staged) rows, throwing an
Scanners found no defects: the check is cheap and protective, cursor-based reads remain the intended escape hatch, and the error type matches existing Reviewed commit: 24adfdb |
Reads inside a transaction merge stored rows with staged writes in memory, so the fetch window grew with the offset and an unbounded offset loaded that many rows into PHP.
TransactionStatenow caps offset plus limit atAPP_LIMIT_COUNTfor these reads, with an error that points to cursor pagination.Test:
TransactionStateTest::testOffsetPastTheWindowInATransactionIsRejected(fails without the change).Verified with
composer lint, PHPStan on the changed files andvendor/bin/phpunit tests/unit/Databases.Related: appwrite-labs/cloud#6674