[core] Fix orphaned parking deletion when parent stop place is missing - #433
Open
teppope wants to merge 3 commits into
Open
[core] Fix orphaned parking deletion when parent stop place is missing#433teppope wants to merge 3 commits into
teppope wants to merge 3 commits into
Conversation
teppope
marked this pull request as ready for review
July 28, 2026 12:01
Collaborator
Author
|
Restored WARN logging |
…ger exists Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
teppope
force-pushed
the
fix/parking-orphan-auth-fallback
branch
from
September 3, 2026 11:55
fa77806 to
a512afa
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.
Summary
Type of change
Issue
When checking authorization for editing or deleting a
Parking, Tiamat always resolves the request to the parking's parentStopPlacefirst (TiamatEntityResolver.resolveCorrectEntity). If the parent stop place no longer exists (e.g. it was deleted without first deleting its child parking), this resolution step threw anIllegalArgumentExceptioninstead of falling back to checking permission on the parking itself - so any attempt to edit or delete the orphaned parking failed outright.This surfaced via an orphan-cleanup end-to-end test that found a leftover parking in a downstream environment whose parent stop place no longer existed; the delete mutation failed with "Parking does not have a parent site ref that points to a stop place."
The fix makes the existing fallback path actually reachable: when the parent stop place cannot be found, permission is checked against the parking itself, the same fallback already used when a parking has no
parentSiteRefat all. Normal-case behaviour (parent stop place exists) is unchanged.ParkingDeleterwas simplified to rely on this shared resolver instead of duplicating parent-resolution logic locally, matching the pattern already used byParkingUpdater.Note: this fix addresses the inability to clean up an already-orphaned parking. It does not change how orphans are created in the first place (i.e.
StopPlaceDeleterstill does not check for or cascade to child parkings) - that is being tracked as a separate follow-up.Unit tests
TiamatEntityResolverTest(new, no prior test existed for this class): covers a parking resolving to its parent stop place, falling back to itself when the parent no longer exists, and falling back to itself when there is no parent at all.ParkingDeleterTestwithdeleteParkingWithUnresolvableParentanddeleteParkingWithNoParentSiteRef, both asserting the parking can now be deleted successfully.mvn test -Dtest=ParkingDeleterTest,TiamatEntityResolverTest).