Skip to content

Add implementation of returnable last_seq - #2170

Draft
veronika-alraheem wants to merge 2 commits into
mainfrom
1286-last-seq
Draft

Add implementation of returnable last_seq#2170
veronika-alraheem wants to merge 2 commits into
mainfrom
1286-last-seq

Conversation

@veronika-alraheem

Copy link
Copy Markdown
Contributor

PR summary

Add implementation of returnable last_seq for safe checkpoint management.

Fixes: i1286

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the
    Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • New tests
  • Build/CI related changes
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

The ChangesFollower API streams changes as individual ChangesResultItem objects but provides no mechanism for users to determine a safe sequence ID to use as a checkpoint. For heavily filtered feeds where pages return empty results, users have no way to advance their checkpoint even though the feed has progressed internally.

What is the new behavior?

A new public method getLastSeqNewerThan(lastPersistedSeqId) is added to ChangesFollower. After fully processing a ChangesResultItem, users can call this method with the item's seq value to obtain the most recent sequence ID that is safe to persist as a checkpoint.

The method advances past any empty pages (e.g. from heavily filtered feeds) that the follower has seen since the given sequence ID, returning the furthest safe checkpoint available at that point.

Does this PR introduce a breaking change?

  • Yes
  • No

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.

1 participant