Fix cascading delete - #3732
Open
meisterT wants to merge 2 commits into
Open
Fix cascading delete #3732meisterT wants to merge 2 commits into
meisterT wants to merge 2 commits into
Conversation
nickygerritsen
approved these changes
Sep 2, 2026
Member
Author
|
Before merging I need to think though the unit tests and think whether it needs an update or points to an issue in the new code |
- Extract checkEntityDeleteConstraints() from buildDeleteTree() to simplify per-entity foreign key checks and eliminate deep loop nesting and multi-level breaks. - Harden getDependentEntities() BFS traversal with a visited set to prevent potential infinite loops on cyclic relationships.
- Handle diamond cascading delete paths for Contest, Team, and ContestProblem in BaseController::commitDeleteEntity by pre-deleting multi-parent leaf and intermediary records (judging_run, external_run, balloon, submission, scorecache) in reverse topological order. - Add missing em->flush() in API ProblemController::unlinkProblemAction. - Add unit tests for Problem, Contest, and Team deletions with full submissions, judgings, and judging runs.
meisterT
force-pushed
the
cascadedelete
branch
from
September 3, 2026 21:01
f19263a to
c38afdd
Compare
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.
No description provided.