Skip to content

fix: explicitly document behavior when cursor entity no longer exists#453

Merged
wschurman merged 1 commit intomainfrom
wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists
Feb 17, 2026
Merged

fix: explicitly document behavior when cursor entity no longer exists#453
wschurman merged 1 commit intomainfrom
wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists

Conversation

@wschurman
Copy link
Member

@wschurman wschurman commented Feb 17, 2026

Why

The one downside of using id-based cursor pagination and subqueries (added in #422, #431) is that it risks the row referenced by the cursor being deleted between pagination requests. It's an edge case though to be clear. Encoding the full cursor alleviates this, but has it's own downsides since trigram similarity isn't encodable and neither are things like Date objects. It is still preferable to use ID-based cursors for all pagination.

But it becomes the library's responsibility to explicitly document what the behavior is when a row referenced by the cursor is no longer present. This PR does this.

How

When the cursor row is no longer present, the tuple evaluates to NULL, which produces a empty page.

The alternative to this behavior is to run an id check query ahead of the pagination query, and throw an error if it doesn't exist, or even return the first page of data if it doesn't exist. Both of these are less optimal since they cause unexpected behavior during results consumption.

So we keep the behavior as is and explicitly document it.

Test Plan

Run new tests.

Copy link
Member Author

wschurman commented Feb 17, 2026

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cc78029) to head (00ac642).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #453    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          109       109            
  Lines        16000     16013    +13     
  Branches       861      1432   +571     
==========================================
+ Hits         16000     16013    +13     
Flag Coverage Δ
integration 23.40% <100.00%> (+0.06%) ⬆️
unittest 95.11% <64.28%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wschurman wschurman force-pushed the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch from b7ccc5e to ecb8a06 Compare February 17, 2026 16:38
@wschurman wschurman force-pushed the wschurman/02-15-fix_eliminate_some_unnecessary_any_casts branch from a83c7cd to d5ce982 Compare February 17, 2026 16:38
@wschurman wschurman force-pushed the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch from ecb8a06 to 94a693f Compare February 17, 2026 17:02
@wschurman wschurman requested review from ide and quinlanj February 17, 2026 17:08
@wschurman wschurman marked this pull request as ready for review February 17, 2026 17:08
@wschurman wschurman force-pushed the wschurman/02-15-fix_eliminate_some_unnecessary_any_casts branch from d5ce982 to 7397d82 Compare February 17, 2026 22:31
@wschurman wschurman force-pushed the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch from 94a693f to 005b82c Compare February 17, 2026 22:31
@wschurman wschurman force-pushed the wschurman/02-15-fix_eliminate_some_unnecessary_any_casts branch from 7397d82 to d4c6c1c Compare February 17, 2026 22:35
@wschurman wschurman force-pushed the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch from 005b82c to e01d842 Compare February 17, 2026 22:35
Copy link
Member Author

wschurman commented Feb 17, 2026

Merge activity

  • Feb 17, 10:40 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 17, 10:53 PM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 17, 10:56 PM UTC: @wschurman merged this pull request with Graphite.

@wschurman wschurman changed the base branch from wschurman/02-15-fix_eliminate_some_unnecessary_any_casts to graphite-base/453 February 17, 2026 22:49
@wschurman wschurman changed the base branch from graphite-base/453 to main February 17, 2026 22:52
@wschurman wschurman force-pushed the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch from e01d842 to 00ac642 Compare February 17, 2026 22:53
@wschurman wschurman merged commit 4dc156c into main Feb 17, 2026
3 checks passed
@wschurman wschurman deleted the wschurman/02-16-fix_explicitly_document_behavior_when_cursor_entity_no_longer_exists branch February 17, 2026 22:56
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.

2 participants

Comments