-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Open-Event Ticket #22
Conversation
Reviewer's Guide by SourceryThis pull request adds support for scanning ticket codes from Open-Event tickets, which are stored as strings, unlike JSON in Eventyay. The server value is now stored and checked before parsing the JSON. Sequence diagram for ticket code scanning processsequenceDiagram
participant User as User
participant App as Check-in App
participant Camera as Camera Store
participant Process as Process Store
User->>App: Scan ticket QR code
App->>Camera: Store QR code value
App->>Process: Check-in request
alt Server is Open-Event
Process->>Process: Create ticket data from string
else Other server
Process->>Process: Parse QR code as JSON
end
Process->>Process: Generate nonce
Process->>Process: Create request body
Process-->>User: Complete check-in process
Class diagram showing updated store structureclassDiagram
class EventyayApi {
+String apitoken
+String url
+String organizer
+String eventSlug
+String servername
+setServer(server)
+setApiCred()
+$reset()
}
class ProcessEventyayCheckIn {
+checkIn()
-handleQRData()
}
ProcessEventyayCheckIn ..> EventyayApi : uses
Flow diagram for QR code processing logicgraph TD
A[Scan QR Code] --> B{Check Server Type}
B -->|Open-Event| C[Create ticket data from string]
B -->|Other| D[Parse QR code as JSON]
C --> E[Generate nonce]
D --> E
E --> F[Create request body]
F --> G[Complete check-in]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Deploy Preview for eventyay-checkin ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Sak1012 - I've reviewed your changes - here's some feedback:
Overall Comments:
- The PR removes the Open-Event login validation check without explanation. Please clarify why this validation is no longer needed and confirm it doesn't introduce security risks.
- There's inconsistent indentation in the new code (mixing tabs and spaces). Please standardize the indentation to match the project's style.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ticket: cameraStore.qrCodeValue | ||
} | ||
} else { | ||
qrData = JSON.parse(cameraStore.qrCodeValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Consider adding error handling for JSON.parse to gracefully handle invalid QR codes
Wrap the JSON.parse in a try-catch block and provide appropriate error feedback to the user when an invalid QR code is scanned.
const printWindow = window.open(blobUrl, '_blank') | ||
if (printWindow) { | ||
printWindow.onload = function () { | ||
printWindow.onload = function() { | ||
printWindow.print() | ||
URL.revokeObjectURL(blobUrl) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider adding error handling for the print window to ensure blobUrl is always cleaned up
Add an onerror handler to clean up the blobUrl if the window fails to load, preventing potential memory leaks.
const printWindow = window.open(blobUrl, '_blank') | |
if (printWindow) { | |
printWindow.onload = function () { | |
printWindow.onload = function() { | |
printWindow.print() | |
URL.revokeObjectURL(blobUrl) | |
} | |
const printWindow = window.open(blobUrl, '_blank') | |
if (printWindow) { | |
printWindow.onload = function() { | |
printWindow.print() | |
URL.revokeObjectURL(blobUrl) | |
} | |
printWindow.onerror = function() { | |
URL.revokeObjectURL(blobUrl) | |
} | |
} else { | |
// Clean up if window failed to open | |
URL.revokeObjectURL(blobUrl) | |
} |
This PR enables scanning ticket codes from open-event tickets which are stored as strings unlike json in the Eventyay.
The Server value is now stored and checked before parsing the json...
Summary by Sourcery
New Features: