ix(frontend): adaptive wallet polling, visibility-aware stats polling, QR fallback, StrictMode cleanup audit - #369
Merged
ALLEN-AYODEJI merged 2 commits intoAug 30, 2026
Conversation
…ling, QR canvas fallback, and StrictMode ref-cleanup hygiene - WalletContext: replace the fixed 3s account poll with per-phase intervals (5s connected, 30s disconnected, none while unavailable/detecting/connecting) plus exponential backoff on consecutive failures. - useContractStats: pause the 60s poll while the tab is hidden, resume with an immediate fetch on visibility, and skip results from requests superseded by a newer one. - AgreementIdGenerator: detect canvas support before generating the QR code and show a readable text-only fallback (with an explanatory message) when it's unavailable, instead of silently rendering nothing. - useCountUp: null out the animation frame ref in its cleanup for consistency with the app's StrictMode ref-cleanup audit (NetworkBackground and useAgreementEvents were already fully compliant). Closes Trellis-Ecosystem#296, Closes Trellis-Ecosystem#297, Closes Trellis-Ecosystem#298, Closes Trellis-Ecosystem#299
|
@Nexha-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
WalletContextnow uses per-phase polling intervals instead of a fixed 3s timer: 5s while connected, 30s while disconnected, and no polling at all while unavailable/detecting/connecting. Consecutive failures back off exponentially (capped at 120s).useEffectin the frontend for StrictMode-safe cleanup.NetworkBackgroundanduseAgreementEventswere already fully compliant (rAF/interval cancellation, abort signals, unmount guards). Added a small hygiene fix touseCountUpto null out its animation-frame ref in cleanup.useContractStatsnow pauses its 60s poll when the tab is hidden (visibilitychange), fetches immediately on becoming visible again, and tags each request with an id so a stale in-flight response can't clobber a newer one.AgreementIdGeneratornow detects canvas support before attempting to render the QR code and falls back to a readable, spaced hex text display with an explanatory message instead of silently showing nothing.Closes #296
Closes #297
Closes #298
Closes #299
Test plan
<StrictMode>and confirm no duplicate intervals/animations/warnings.