refactor: use SDK stream_bundles() for bundle cache pagination#258
Merged
refactor: use SDK stream_bundles() for bundle cache pagination#258
Conversation
Fraser999
reviewed
Apr 2, 2026
Contributor
Fraser999
left a comment
There was a problem hiding this comment.
Just some tracing issues, some of which exist in the TxPoller too.
Fraser999
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes ENG-2117.
Summary
Replace manual cursor pagination in
BundlePollerwithstream_bundles().try_collect()— the SDK now providesBuilderTxCache::stream_bundles()which handles authenticated, paginated bundle fetching. The builder was reimplementing this with a hand-rolled cursor loop.Align
BundlePollerstyle withTxPoller—TxPolleralready usesstream_transactions().try_collect()andinspect_errfor error handling. This PR brings the bundle poller into the same pattern:inspect_erron the result, span guard in the success body, and no enter/drop span dance around theis_closedcheck.Preserve
NotOurSlothandling — the special-case trace log for slot-gated bundle fetching is maintained in theinspect_errclosure, distinct from the general error counter + warn path.Net result: -37 lines, +16 lines. Pagination is now fully delegated to the SDK for both transactions and bundles.
Test plan
make clippypasses with no warningsmake testpasses (8 unit tests, integration tests require env config)make fmtclean🤖 Generated with Claude Code