Skip to content

fix: close Didit SDK modal on 'In Review' status#1899

Closed
Nesopie wants to merge 2 commits intodevfrom
fix/didit-under-review
Closed

fix: close Didit SDK modal on 'In Review' status#1899
Nesopie wants to merge 2 commits intodevfrom
fix/didit-under-review

Conversation

@Nesopie
Copy link
Copy Markdown
Collaborator

@Nesopie Nesopie commented Apr 1, 2026

Summary

  • Close the Didit SDK modal immediately when onComplete fires, regardless of status
  • When Didit returns 'In Review', the SDK shows its own "Your submission is under review" screen that blocks the UI indefinitely
  • By calling DiditSdk.shared.close() before emitting the result, our "Processing verification..." screen takes over and Socket.IO waits for the TEE webhook

Problem

Didit SDK fires onComplete({type: 'completed', session: {status: 'In Review'}}) but keeps its modal visible, showing a pending screen. The user sees Didit's UI instead of ours, with no way to proceed until the review completes.

Fix

Call DiditSdk.shared.close() in emitOnce() before invoking the complete/error callback. This dismisses the modal so our waiting UI can show while Socket.IO subscribes and waits for the signed attestation.

Test plan

  • Didit modal closes after verification submission
  • "Processing verification..." screen shows while waiting for TEE
  • Attestation arrives via Socket.IO after Didit approves

Summary by CodeRabbit

  • New Features

    • Added a dedicated "verification pending" screen and explicit back navigation; separated the loading spinner into its own state and updated loading text to "Loading verification...".
    • Placeholder support added for receiving live updates during pending verification.
  • Bug Fixes

    • Modal now reliably closes immediately when verification completes or errors, ensuring proper termination of the process.

When Didit returns 'In Review', the SDK shows its own pending screen
that blocks the UI. Close the modal as soon as onComplete fires so
our Socket.IO waiting flow can take over.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
self-webview-app Ready Ready Preview, Comment Apr 1, 2026 10:37am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2943cc93-3c62-4b27-88de-a1e6570bc740

📥 Commits

Reviewing files that changed from the base of the PR and between 70c4025 and 70a389f.

📒 Files selected for processing (1)
  • packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx

📝 Walkthrough

Walkthrough

Two small UI and SDK lifecycle updates: the Didit SDK now closes immediately on the first terminal result, and the onboarding ProviderLaunchScreen separates waiting vs loading render paths and wires a KycPendingScreen with back and live-update handlers.

Changes

Cohort / File(s) Summary
DiditSdk lifecycle
packages/webview-app/src/utils/diditProvider.ts
Added an explicit DiditSdk.shared.close() call inside the emitOnce(...) terminal-result handler so the SDK is closed immediately on first error or success, before calling config.onError/config.onComplete.
Onboarding UI: loading vs waiting
packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx
Refactored render branches to separately handle phase === 'waiting' (renders KycPendingScreen with onCheckBackLater and placeholder onReceiveLiveUpdates) and phase === 'loading' (renders a loading spinner and a fixed Title "Loading verification..."); removed Description conditional previously shown for waiting state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding explicit SDK modal closure when the Didit API returns 'In Review' status, which is the core fix in this PR.
Description check ✅ Passed The description provides a clear summary of the problem, the fix, and test plan. While the Native Consolidation Checklist section from the template is not completed, the core required sections (Summary and Test plan) are present and substantially filled out.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/didit-under-review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Replace the generic spinner with Euclid's KycPendingScreen when
verification is under review. Shows animation, 'Check back later'
and 'Receive live updates' buttons.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Nesopie
Copy link
Copy Markdown
Collaborator Author

Nesopie commented Apr 1, 2026

Superseded by #1900 — same changes rebased onto feat/stitch-screens-with-provingmachine

@Nesopie Nesopie closed this Apr 1, 2026
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