Skip to content

refactor: use SDK stream_bundles() for bundle cache pagination#258

Merged
Evalir merged 3 commits intomainfrom
dylan/bundle-poller-stream
Apr 2, 2026
Merged

refactor: use SDK stream_bundles() for bundle cache pagination#258
Evalir merged 3 commits intomainfrom
dylan/bundle-poller-stream

Conversation

@Evalir
Copy link
Copy Markdown
Member

@Evalir Evalir commented Apr 1, 2026

Closes ENG-2117.

Summary

  • Replace manual cursor pagination in BundlePoller with stream_bundles().try_collect() — the SDK now provides BuilderTxCache::stream_bundles() which handles authenticated, paginated bundle fetching. The builder was reimplementing this with a hand-rolled cursor loop.

  • Align BundlePoller style with TxPollerTxPoller already uses stream_transactions().try_collect() and inspect_err for error handling. This PR brings the bundle poller into the same pattern: inspect_err on the result, span guard in the success body, and no enter/drop span dance around the is_closed check.

  • Preserve NotOurSlot handling — the special-case trace log for slot-gated bundle fetching is maintained in the inspect_err closure, 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 clippy passes with no warnings
  • make test passes (8 unit tests, integration tests require env config)
  • make fmt clean
  • Verify bundle ingestion in staging with >50 bundles available

🤖 Generated with Claude Code

Copy link
Copy Markdown
Member Author

Evalir commented Apr 1, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Evalir Evalir marked this pull request as ready for review April 1, 2026 15:21
Copy link
Copy Markdown
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some tracing issues, some of which exist in the TxPoller too.

@Evalir Evalir enabled auto-merge (squash) April 2, 2026 14:27
@Evalir Evalir merged commit f812a17 into main Apr 2, 2026
6 checks passed
@Evalir Evalir deleted the dylan/bundle-poller-stream branch April 2, 2026 14:28
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