Skip to content

fix: isolate label loading by chain - #725

Merged
Seranged merged 1 commit into
developmentfrom
fix/chain-scoped-label-loads
Jul 10, 2026
Merged

Seranged merged 1 commit into
developmentfrom
fix/chain-scoped-label-loads

Conversation

@Seranged

Copy link
Copy Markdown
Contributor

Summary

  • Scope in-flight label fetches by target chain so rapid network switches cannot share or publish wrong-chain results.
  • Keep label readiness, loading, snapshot, and wrap-pair state aligned with the latest active chain load.

Changes

  • Reuse only the underlying fetch for the same target chain while per-call generations control publication.
  • Guard state writes and asynchronous wrap-pair probes with load generation, probe generation, loaded-label chain, and current-chain checks.
  • Cover A to B, A to B to A, force-refresh replacement, and stale-probe races with deterministic composable tests.

Test plan

  • npm run test:run -- tests/composables/useEulerLabels.test.ts tests/composables/useEulerAccount.test.ts
  • npm run typecheck
  • npx eslint composables/useEulerLabels.ts tests/composables/useEulerLabels.test.ts
  • git diff --check

Residual

  • PR Add multi-chain vault browsing #619 also changes useEulerLabels and currently has a conflicting merge state; whichever change lands second must preserve these request-scoping guards during conflict resolution.

Track in-flight label fetches per chain and gate publication on the latest active load. Cover chain switches, fetch reuse, force refreshes, and stale wrap-pair probes.
@railway-app
railway-app Bot temporarily deployed to euler-lite / euler-lite-pr-725 July 10, 2026 09:19 Destroyed
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository: euler-xyz/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24170420-addd-4123-8f76-6d1356d04b66

📥 Commits

Reviewing files that changed from the base of the PR and between 5b97c37 and 4b47120.

📒 Files selected for processing (2)
  • composables/useEulerLabels.ts
  • tests/composables/useEulerLabels.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/chain-scoped-label-loads

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

@railway-app

railway-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

🚅 Deployed to the euler-lite-pr-725 environment in euler-lite

Service Status Web Updated (UTC)
dev-build ✅ Success (View Logs) Web Jul 10, 2026 at 9:20 am

@LeonardEulerXYZ LeonardEulerXYZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking findings at 4b4712052630f9762b9c2a5b817938909ee86abb.

The per-chain in-flight map and latest-load generation guard keep products/entities/vault-label publication coherent across A→B and A→B→A switches. The identity-checked cleanup preserves a force-refresh replacement, and the additional chain/load/probe checks prevent stale wrap-pair writeback. The map remains bounded by the configured chain set and settled entries are removed.

Validation performed:

  • npm run test:run -- tests/composables/useEulerLabels.test.ts tests/composables/useEulerAccount.test.ts tests/composables/useVaults.test.ts tests/composables/useGeoBlock-wrap-pair.test.ts tests/utils/euler-labels-utils.test.ts tests/composables/useEulerOracleAdapters.test.ts (44 tests passed)
  • npm run typecheck
  • npx eslint composables/useEulerLabels.ts tests/composables/useEulerLabels.test.ts
  • git diff --check origin/development...HEAD

I did not run browser/API smoke: the changed behavior is deterministic in-flight ordering and stale-publication suppression, which the deferred unit tests exercise directly; the live labels proxy cannot reliably reproduce those races.

@Seranged
Seranged merged commit 107ef2c into development Jul 10, 2026
5 checks passed
@Seranged
Seranged deleted the fix/chain-scoped-label-loads branch July 10, 2026 12:39
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.

3 participants