Skip to content

Conversation

@coodos
Copy link
Contributor

@coodos coodos commented Nov 21, 2025

Description of change

Issue Number

Type of change

  • Breaking (any change that would cause existing functionality to not work as expected)
  • New (a change which implements a new feature)
  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)
  • Docs (changes to the documentation)
  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

Release Notes

  • New Features
    • Reference submission now includes an optional digital signing step with QR code (desktop) or deep link (mobile).
    • Real-time signing progress monitoring with status indicators.
    • Session countdown timer with automatic expiration after 15 minutes.
    • Try Again option available for retry scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR integrates a real-time signing flow into the reference modal component. After reference submission, if a signing session is provided by the server, the modal initiates an SSE connection to monitor signing progress, displays a QR code or deep link for mobile users, manages session expiry with a countdown timer, and conditionally renders UI based on signing status.

Changes

Cohort / File(s) Summary
Reference Modal Signing Flow
platforms/eReputation/client/src/components/modals/reference-modal.tsx
Adds signing session state management (id, QR data, expiry), signing status tracking (pending, connecting, signed, expired, error, security_violation), and 15-minute countdown timer. Implements SSE connection to receive real-time signing progress updates. Adds UI branches for signing interface (QR code display, mobile deep link prompt) with status indicators and error handling. Updates form submission to conditionally show signing UI or reference form based on session state. Cleans up SSE connections on unmount and state resets. Enhanced imports include QRCodeSVG, mobile-detection utilities, and additional React hooks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Modal as Reference Modal
    participant Server
    participant SSE as SSE Stream
    participant Cache as Invalidation Cache

    User->>Modal: Submit Reference Form
    Modal->>Server: Create Reference + Request Signing Session
    Server->>Modal: Return signingSession (id, QR, expiry)
    
    rect rgb(230, 240, 250)
        Note over Modal: Initialize Signing State
        Modal->>Modal: Set signingStatus = "connecting"
        Modal->>Modal: Render QR Code / Deep Link
        Modal->>Modal: Start 15-min Countdown Timer
    end
    
    Modal->>SSE: Establish SSE Connection (sessionId)
    SSE->>Modal: Monitor for Signing Events
    
    rect rgb(240, 250, 240)
        Note over SSE,Cache: Signing Complete Path
        SSE->>Modal: "signed" Event
        Modal->>Modal: Set signingStatus = "signed"
        Modal->>Cache: Invalidate Reference Cache
        Modal->>User: Success Toast
        Modal->>Modal: Close Modal (after delay)
    end
    
    rect rgb(250, 240, 240)
        Note over SSE,Modal: Error Paths
        alt Session Expired
            SSE->>Modal: "expired" Event
            Modal->>Modal: Set signingStatus = "expired"
        else Security Violation
            SSE->>Modal: "security_violation" Event
            Modal->>Modal: Set signingStatus = "security_violation"
        end
        Modal->>User: Error Indicator + Try Again Button
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • SSE Connection Management: Verify proper initialization, error handling, and cleanup of EventSource to prevent memory leaks
  • Countdown Timer Logic: Confirm useEffect dependencies, timer accuracy, and proper cleanup/expiry handling
  • State Transitions: Trace signing status state machine and verify all conditional branches (connecting → signed/expired/error)
  • UI Conditional Rendering: Review form/signing UI toggle logic and ensure no duplicate buttons or missing user actions during signing
  • Mobile Deep Link Flow: Validate mobile detection and deep link rendering as fallback to QR code

Suggested labels

evault-refactor

Suggested reviewers

  • sosweetham
  • xPathin

Poem

🐰 A reference now signs with a hop and a glow,
QR codes dancing in real-time's soft flow,
Fifteen minutes to sign, a countdown so quick,
SSE streams the truth—oh, what a trick!
From pending to signed, the modal's now spry,

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ereputation-signing-modal

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47efb6d and b92308a.

📒 Files selected for processing (1)
  • platforms/eReputation/client/src/components/modals/reference-modal.tsx (6 hunks)

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.

@coodos coodos marked this pull request as ready for review November 21, 2025 08:00
@coodos coodos merged commit 774e2ce into main Nov 21, 2025
3 of 4 checks passed
@coodos coodos deleted the fix/ereputation-signing-modal branch November 21, 2025 08:02
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.

2 participants