Skip to content

chore(bridge): prewarm hook, route key docs, quote retry rename#224

Merged
cursor[bot] merged 1 commit intofeat/bridge-preview-prewarmfrom
cursor/bridge-prewarm-cleanup-529f
Apr 14, 2026
Merged

chore(bridge): prewarm hook, route key docs, quote retry rename#224
cursor[bot] merged 1 commit intofeat/bridge-preview-prewarmfrom
cursor/bridge-prewarm-cleanup-529f

Conversation

@tansawit
Copy link
Copy Markdown
Contributor

@tansawit tansawit commented Apr 14, 2026

Follow-up cleanup from PR #223 review:

  • Prewarm hook: useBridgeRoutePreparationPrewarm runs the same preparation queries with a void return type so the side-effect-only usage is explicit in BridgeFields.
  • Imports: Single @/data/signer import for useOfflineSigner and related hooks in preparation.ts.
  • React Query: Removed duplicate staleTime on useBridgeTxQuery (still set via spread from createBridgeTxQueryOptions / placeholder options).
  • Documentation: Comments linking getBridgePreparationRouteKey (tx cache identity) and getRouteSignature in useRouteRefresh (preview “meaningful change” detection).
  • Rename: messageRequestKey.tsquoteRefreshRetry.ts (git rename) for shouldRetryBridgeMsgsAfterQuoteRefresh.

Tests: pnpm exec vitest run src/pages/bridge (and targeted FooterWithMsgs); pnpm exec tsc --noEmit in package.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Refactor

    • Optimized internal bridge route preparation caching and data handling.
    • Reorganized hook structures for improved route pre-loading efficiency.
    • Updated import organization for signer dependencies.
  • Tests

    • Updated test imports to reflect refactored data structures.

…module

Rename messageRequestKey to quoteRefreshRetry, merge duplicate signer imports,
drop redundant staleTime in useBridgeTxQuery, add cross-references between
bridge tx cache keys and preview route signatures, and expose
useBridgeRoutePreparationPrewarm for side-effect-only preparation.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4400b719-0691-4dda-9c39-e565faa0ac2d

📥 Commits

Reviewing files that changed from the base of the PR and between 0e6d21f and 29b4837.

📒 Files selected for processing (7)
  • packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx
  • packages/interwovenkit-react/src/pages/bridge/FooterWithMsgs.test.ts
  • packages/interwovenkit-react/src/pages/bridge/FooterWithMsgs.tsx
  • packages/interwovenkit-react/src/pages/bridge/data/preparation.ts
  • packages/interwovenkit-react/src/pages/bridge/data/preparedRoute.ts
  • packages/interwovenkit-react/src/pages/bridge/data/quoteRefreshRetry.ts
  • packages/interwovenkit-react/src/pages/bridge/data/useRouteRefresh.ts

Walkthrough

Refactored bridge route preparation logic to introduce a dedicated prewarm hook for background fetching, reorganized route signature computation for caching purposes, and consolidated import paths for retry-related utilities across multiple files.

Changes

Cohort / File(s) Summary
Hook Refactoring
packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx, packages/interwovenkit-react/src/pages/bridge/data/preparedRoute.ts
Renamed useBridgeRoutePreparation to internal-only useBridgeRoutePreparationInternal and introduced new exported useBridgeRoutePreparationPrewarm hook for explicit background fetching. Updated BridgeFields to call the prewarm variant.
Import Path Consolidation
packages/interwovenkit-react/src/pages/bridge/FooterWithMsgs.tsx, packages/interwovenkit-react/src/pages/bridge/FooterWithMsgs.test.ts
Updated import source of shouldRetryBridgeMsgsAfterQuoteRefresh from ./data/messageRequestKey to ./data/quoteRefreshRetry.
Preparation Logic
packages/interwovenkit-react/src/pages/bridge/data/preparation.ts
Added getBridgePreparationRouteKey() function to compute stable React Query cache key based on route subset (amounts, chain identifiers, operations, and hook). Removed hardcoded staleTime override from useBridgeTxQuery, deferring to txOptions control. Consolidated signer imports into grouped multi-line statement.
Documentation
packages/interwovenkit-react/src/pages/bridge/data/useRouteRefresh.ts
Added block comment clarifying distinction between getRouteSignature() (broader, user-visible route changes) and getBridgePreparationRouteKey() (caching key), documenting intentional separation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A prewarm breeze now whispers through the bridge,
Cache-keys dance upon the data ridge.
Import paths aligned, no more confusion—
Routes sing sweeter with this refusion! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: introducing a prewarm hook, adding route key documentation, and renaming quote retry imports—all central to this cleanup PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/bridge-prewarm-cleanup-529f

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying interwovenkit with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29b4837
Status: ✅  Deploy successful!
Preview URL: https://8e105467.interwovenkit.pages.dev
Branch Preview URL: https://cursor-bridge-prewarm-cleanu.interwovenkit.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying interwovenkit-staging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29b4837
Status: ✅  Deploy successful!
Preview URL: https://be0179e4.interwovenkit-staging.pages.dev
Branch Preview URL: https://cursor-bridge-prewarm-cleanu.interwovenkit-staging.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying interwovenkit-testnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29b4837
Status: ✅  Deploy successful!
Preview URL: https://d5254965.interwovenkit-testnet.pages.dev
Branch Preview URL: https://cursor-bridge-prewarm-cleanu.interwovenkit-testnet.pages.dev

View logs

@cursor cursor bot merged commit 29b4837 into feat/bridge-preview-prewarm Apr 14, 2026
5 of 6 checks passed
@cursor cursor bot deleted the cursor/bridge-prewarm-cleanup-529f branch April 14, 2026 14:52
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