Skip to content

Add unit tests for the pagination cursor encoder and decoder round-tripping without data loss #679

Description

@Chucks1093

Summary

The cursor-based pagination system encodes a database row ID and sort value into an opaque cursor string and decodes it on the next request. Unit tests should confirm the encode→decode round-trip is lossless for all supported field types.

Scope

  • Test encoding and decoding a cursor with an integer ID and timestamp sort value
  • Test encoding and decoding a cursor with a string ID and numeric sort value
  • Test that a tampered cursor string (base64 modified mid-string) throws InvalidCursor
  • Test that an empty string cursor throws InvalidCursor
  • Assert decoded values are strictly equal (not just loosely equal) to the originals

Acceptance Criteria

  • Integer ID and timestamp round-trips without data loss
  • String ID and numeric sort value round-trips correctly
  • Tampered cursor throws InvalidCursor
  • Empty string cursor throws InvalidCursor
  • Decoded values strictly equal originals

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions