-
Notifications
You must be signed in to change notification settings - Fork 23
Ck 7vn/id 507 #1045
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
Ck 7vn/id 507 #1045
Conversation
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.
Works Well and the tests pass. Good job! Minor adjustment on: class_event.go and we are good. I approve your code, but not related to your PR, but something that copilot flagged are :
High Priority: Race Conditions (Data Loss Risk)
Functions affected:
handleAttendanceChange() - Lines ~200-220
handleReasonChange() - Lines ~225-240
handleNoteChange() - Lines ~195-200
Real-world scenario: User rapidly clicks status → selects reason → types note, and only the last change persists due to race conditions between the three update functions.
Medium Priority: Memory Leaks
Functions affected:
State initialization (lines 94-97) - modifiedRows never gets cleaned up
useEffect (lines 125-144) - Keeps accumulating data from different pages
Real-world scenario: User navigates through 10 pages with 20 users each = 200 entries in modifiedRows object that never get cleared, growing memory usage indefinitely. This gives your coworker concrete examples of exactly where the problems occur and what user behavior triggers them.
|
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.
@CK-7vn Tested good and everything persists. I did have a weird error occur that needs attention. When I first select 'Excused' or 'Unexcused' and don't make any selection leaving the default of 'Lockdown' the message 'is required' shows up. Fix this and the github conflicts and is good to go
carddev81
left a comment
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.
On edit of event attendances, when I select a different reason and click save it doesn't keep the changes, fix this and it should be ready to go
carddev81
left a comment
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.
Tested good
Description of the change
Adds categorized dropdown reasons for excused and unexcused when taking attendance.
Screenshot(s)
Additional context
Please include additional context or information that the reviewer needs to understand the PR. This includes:
Included a bug fix that occured in database/class_events.go where we were only searching for attendance that was linked to the latest schedule rule (event id) for the class.
So, i just fetched all the event IDs, first retrieve all of the event ids associated with said class_id, query by list, and expand the date range to filter the entirety of the requested month (time period)