Commit 647dffa
fix: harden cursor pagination against null values and stale keys
Three small follow-ups based on review feedback on the audit PR's twin
implementation:
- Drop the always-true `!empty($orderAttributes)` guard inside the cursor
branch. resolveCursorOrder() always appends an `id` tiebreaker, so the
guard is dead code and was misleading.
- normalizeCursorRow now removes `$id` after copying it to `id`, so cursor
state is no longer carrying both keys.
- Throw an explicit Exception when a cursor value is null. The previous
path silently routed null `time` cursors through formatDateTime(null)
which returns the current timestamp — a misconfigured cursor would
filter on `time < now()` and produce wrong pages instead of failing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4298db5 commit 647dffa
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1523 | 1523 | | |
1524 | 1524 | | |
1525 | 1525 | | |
1526 | | - | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
1527 | 1529 | | |
1528 | 1530 | | |
1529 | 1531 | | |
| |||
2446 | 2448 | | |
2447 | 2449 | | |
2448 | 2450 | | |
| 2451 | + | |
2449 | 2452 | | |
2450 | 2453 | | |
2451 | 2454 | | |
| |||
2524 | 2527 | | |
2525 | 2528 | | |
2526 | 2529 | | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
2527 | 2533 | | |
2528 | 2534 | | |
2529 | 2535 | | |
2530 | 2536 | | |
2531 | 2537 | | |
2532 | | - | |
| 2538 | + | |
2533 | 2539 | | |
2534 | 2540 | | |
2535 | 2541 | | |
2536 | 2542 | | |
2537 | | - | |
| 2543 | + | |
2538 | 2544 | | |
2539 | 2545 | | |
2540 | 2546 | | |
2541 | 2547 | | |
2542 | 2548 | | |
2543 | 2549 | | |
2544 | 2550 | | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
2545 | 2554 | | |
2546 | 2555 | | |
2547 | 2556 | | |
2548 | 2557 | | |
2549 | 2558 | | |
2550 | 2559 | | |
2551 | | - | |
| 2560 | + | |
2552 | 2561 | | |
2553 | 2562 | | |
2554 | 2563 | | |
2555 | 2564 | | |
2556 | | - | |
| 2565 | + | |
2557 | 2566 | | |
2558 | 2567 | | |
2559 | 2568 | | |
| |||
0 commit comments