Fix Duplicate Attendance Scan Confirmation - #468
Open
raj1246 wants to merge 1 commit into
Open
Conversation
raj1246
requested review from
AnshRaj112,
GuinAditi,
fed-tech,
rudrika08 and
shing1Sks
as code owners
July 25, 2026 20:31
|
@raj1246 is attempting to deploy a commit to the fedkiitgmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. 😊 |
There was a problem hiding this comment.
🎉 Thank you @raj1246 for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better.
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.
Description
This PR resolves the issue where scanning a participant's QR code resulted in multiple success/error notifications and multiple attendance API requests being triggered for a single scan.
Root Cause
The duplicate confirmations were caused by a combination of:
Stale React closures where the scanner callback captured outdated state values during initialization.
No processing guard, allowing the scanner to invoke the scan callback multiple times per second for the same QR code.
Asynchronous state updates, preventing the scanner from stopping immediately after a successful scan.
Changes Made
AttendancePage.jsx
Testing
Verified successful attendance marking displays a single confirmation.
Verified duplicate API requests are no longer generated for the same QR scan.
Verified scanner recovery after failed scans.
Verified repeated scans of different participants continue to function normally.