Repository navigation
fix: waiting list duplicate check with a student or course that isn't saved yet - #1583
Merged
yuryyas merged 1 commit intoNov 16, 2026
Merged
Conversation
… saved yet WaitingList.prePersist runs WaitingListUtils.waitingListExists, which queried by student and course. When either is new in the same commit, Cayenne throws "Temporary id, probably an attempt to use NEW object as a query parameter". That rolls back replication groups from willow with a new student and their waiting list (oncourse-secret InboundReplicationHandlerTest.testMainFlow). A record that isn't saved yet can't have a waiting list, so skip the query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yuryyas
deleted the
fix_waiting_list_duplicate_check_for_unsaved_student
branch
November 16, 2026 19:59
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.
Summary
WaitingList.prePersist→validateDuplicate→WaitingListUtils.waitingListExistsqueriesWaitingListby student and course. When the student or course is new in the same commit, Cayenne throws and the whole commit rolls back:Replication from willow hits this: a group with a new Student and their WaitingList fails, as reproduced by oncourse-secret
InboundReplicationHandlerTest.testMainFlow(see ishgroup/oncourse-secret#125). Whether it happens in production depends on willow sending both in one group, which I haven't confirmed.Duplicate checks for saved students and courses are unchanged. This covers the API service caller and the
prePersist/preUpdatecallers.Evidence
New
WaitingListTest(integration):Temporary id, probably an attempt to use NEW object as a query parameter.After: both pass.
testCreateWithNewStudentAndCourse: a new course, student and waiting list commit together.testDuplicateIsRejected: a second waiting list for the same saved student and course is still rejected with "already exists".EnrolmentLifecycleListenerTest(3) andDataCollectionApiTest(8).Merge Danger
Door: two-way
Blast Radius: small. Waiting list creation only. The one behaviour change: the duplicate check is skipped when the student or course is new, which can't match an existing waiting list.
After merge, the next 99-SNAPSHOT
server-jarshould turntestMainFlowgreen in oncourse-secret#125.🤖 Generated with Claude Code