Skip to content

fix(worldcoin): poll verification status to keep badge in sync#222

Merged
dDevAhmed merged 3 commits into
DigiNodes:mainfrom
RUKAYAT-CODER:fix/worldcoin-badge-desync
Jun 1, 2026
Merged

fix(worldcoin): poll verification status to keep badge in sync#222
dDevAhmed merged 3 commits into
DigiNodes:mainfrom
RUKAYAT-CODER:fix/worldcoin-badge-desync

Conversation

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Summary

Fixes the Worldcoin "Verified" badge desync by adding a configurable polling interval to useWorldcoinVerification that re-fetches the backend status every 30 seconds, keeping the badge in sync without requiring a page reload.

Changes

  • src/hooks/useWorldcoinVerification.ts:
    • Added pollInterval option (default 30_000 ms, pass to disable)
    • Added useEffect that sets up setInterval to call
      efresh() periodically
    • Skips polling while status === 'IN_PROGRESS' to avoid race conditions
    • Cleans up interval on unmount
  • src/tests/integration/worldcoin-badge-desync.test.tsx: added invariant tests for polling setup, cleanup on unmount, and disabled polling when pollInterval is 0

closes #189

@dDevAhmed dDevAhmed merged commit 54a68e0 into DigiNodes:main Jun 1, 2026
1 check failed
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.

Worldcoin "Verified" badge desync

2 participants