Skip to content

Improve wallet init, manifest handling, and observability#81

Open
andreivcodes wants to merge 16 commits intomainfrom
fix/sentry-wallet-manifest-stability
Open

Improve wallet init, manifest handling, and observability#81
andreivcodes wants to merge 16 commits intomainfrom
fix/sentry-wallet-manifest-stability

Conversation

@andreivcodes
Copy link
Member

@andreivcodes andreivcodes commented Feb 24, 2026

Summary

  • improve wallet connector initialization and session restore behavior
  • add and harden wallet manifest endpoint/proxy caching behavior
  • refine telemetry setup and noise filtering for Sentry/PostHog
  • add relay/client observability logging and governance parsing hardening

Testing

  • not run in this step

Open with Devin

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.
@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
citizens-house Ready Ready Preview, Comment Feb 24, 2026 1:09pm

Request Review

devin-ai-integration[bot]

This comment was marked as resolved.

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.
devin-ai-integration[bot]

This comment was marked as resolved.

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.

1 participant