Improve wallet init, manifest handling, and observability#81
Open
andreivcodes wants to merge 16 commits intomainfrom
Open
Improve wallet init, manifest handling, and observability#81andreivcodes wants to merge 16 commits intomainfrom
andreivcodes wants to merge 16 commits intomainfrom
Conversation
Use object connect options for the upgraded NearConnector API and clear cached WalletConnect init state when initialization fails. This restores wallet selection behavior after the near-connect upgrade and prevents a one-time SignClient.init failure from blocking future wallet connect attempts. Validation: - pnpm --filter @near-citizens/citizens-house lint ✅ - pnpm --filter @near-citizens/citizens-house build ✅ - pnpm --filter @near-citizens/citizens-house test ✅
Guard WalletConnect bootstrap failure so wallet selection opens even when WalletConnect initialization fails, while still lazily loading the client. Add manifest proxy caching improvements by deduplicating concurrent fetches, reusing the latest manifest cache, and returning explicit cache-control headers to allow edge/browser reuse on near-wallet manifest requests.
posthog-recorder.js and the initial DOM snapshot were loading during page hydration, blocking the main thread for 100-315ms per frame on the proposals detail page. Add disable_session_recording: true to posthog.init() so the recorder script is not fetched on init, then call startSessionRecording() once window.load fires. All other PostHog capture (analytics, heatmaps, dead clicks) is unaffected.
- Remove /Unexpected Suspense handler tag/i from ignoreErrors; it was suppressing the error globally via the InboundFilters event processor (step 5), preventing the scoped /proposals beforeSend check (step 6) from ever running. Now only /proposals routes suppress this error. - Restore WalletConnect sessions on page reload: when the fast startup connector (no WC) can't find the previously selected wallet, check localStorage for a saved wallet ID and retry with a WC-enabled connector so returning WC users are not silently logged out. - Guard connect() against concurrent calls with a useRef flag to prevent accumulation of irremovable anonymous window message listeners that NearConnector registers on each new instance.
Add ignoreErrors for HOT wallet dismissal ("Wallet closed"),
WalletConnect user cancellation, session proposal timeout, and
IndexedDB cleanup race from @walletconnect/safe-json.
Add beforeSend frame filters to drop errors from @hot-labs
SandboxedWallet iframe internals and Next.js stale deployment
"Load failed" noise (server action ID rotation on deploy).
Add 5 s AbortController timeout per upstream fetch so a hung CDN source cannot stall the shared promise indefinitely. Return 503 + Cache-Control: no-store when both sources fail and the in-memory cache is cold, preventing browsers and CDNs from caching an empty wallet list as a success response.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Serve cached wallet manifest immediately and refresh it in the\nbackground when stale so selector requests do not block on\nupstream outages.\n\nGuard Sentry client filtering for missing event hints and keep the\nexisting connected wallet connector when users cancel wallet\nselection, preventing session-less connector swaps.
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
Testing