Skip to content

fix: reject invalid savings pagination cursors#1060

Open
brentthomas248 wants to merge 1 commit into
Remitwise-Org:mainfrom
brentthomas248:codex/savings-cursor-validation
Open

fix: reject invalid savings pagination cursors#1060
brentthomas248 wants to merge 1 commit into
Remitwise-Org:mainfrom
brentthomas248:codex/savings-cursor-validation

Conversation

@brentthomas248

Copy link
Copy Markdown

Closes #1016

Summary:

  • Add focused cursor-validation tests for active get_goals and archived get_archived_goals_page pagination.
  • Cover empty indexes with non-zero cursors, cursor 0, past-highest IDs, u32::MAX, stale active/archived cursors, and valid monotonic traversal without duplicates.
  • Fix the empty-index paths so non-zero cursors reject consistently instead of returning an empty page.

Verification:

  • cargo test -p savings_goals cursor -- --nocapture
  • cargo clippy -p savings_goals -- -D warnings
  • git diff --check
  • rustfmt --edition 2021 savings_goals/src/lib.rs savings_goals/src/test.rs

Notes:

  • cargo test -p savings_goals -- --nocapture currently fails on the upstream baseline before this patch with unrelated existing failures: four goal-name validation tests and tests_safe_math::checked_add_returns_error_on_zero_amount.
  • cargo fmt --all is currently blocked by an unrelated existing syntax error in reporting/src/lib.rs; the touched savings_goals files were formatted directly.

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.

Add cursor-validation negative tests proving get_goals rejects unknown cursors without panicking

1 participant