You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor!: retire the legacy vehicle claim event - #72
Replace the legacy cancellable VehicleOwnerClaimedEvent with the existing VehicleOwnershipChangeEvent CLAIM pre-event and paired VehicleOwnershipChangedEvent. Cancellation still prevents every write and reports failure under the same operation ID. This intentionally removes a public event and must ship with the coordinated SimpleFactions modern guard/legacy bridge update.
Also fix the accepted TLibs 2.6.1 carryover: when SQLite rolls back an Error, VehicleRepository now restores both eager occupancy and tracked-car caches before rethrowing the original Error. Persisted formats, names mode, ownership authority, raw legacy records and migration/hold readers stay intact.
Full 41-repository source and 89-distinct-JAR binary/reflection/config census found only the known SimpleFactions fallback guard as a consumer of the removed event.
Isolated class loading with actual VF 2.10.0, published 2.13.0 and this candidate selects the appropriate SF guard, links its Bukkit handler signature and avoids loading the legacy bridge under modern providers.
Real released TLibs 2.6.1 regression: before fix SQL rolled back while both caches stayed changed; after fix rows/caches agree, Error identity is preserved and reopen is stable. Default-pin provider-contract regression also demonstrates red/green. The compile dependency pin remains unchanged.
Deploy only with the reviewed SF counterpart after verified 6c Dev activation, in a stopped coherent cohort. If versions are split, upgrade SF first. Retain the complete 6c rollback set; no Main deployment.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Summary
Summary by CodeRabbit
Bug Fixes
Database transactions now restore vehicle records and indexes if an error occurs, while rethrowing the original error.
Changes
Vehicle ownership claims and takeovers no longer fire the legacy VehicleOwnerClaimedEvent. Ownership changes continue to use VehicleOwnershipChangeEvent, which can cancel the change before it is saved.
The legacy claim event and its cancellation capability have been removed. Integrations relying on it should use the ownership-change event instead.
The repository now rebuilds cached state after transaction failures caused by an Error. The legacy VehicleOwnerClaimedEvent was removed, and ownership claim handling and tests now use VehicleOwnershipChangeEvent.
Changes: Transaction recovery
Layer / File(s)
Summary
Error recovery and validation src/main/java/net/tfminecraft/vehicleframework/database/VehicleRepository.java, src/test/java/net/tfminecraft/vehicleframework/database/TrackedCarIndexTest.java
Transaction failure handling now catches Error as well as RuntimeException. A new test checks that the original error is rethrown and that repository indexes and live rows are restored before and after reopening the database.
Ownership event removal
Layer / File(s)
Summary
Claim flow and event test updates src/main/java/net/tfminecraft/vehicleframework/events/VehicleOwnerClaimedEvent.java, src/main/java/net/tfminecraft/vehicleframework/ownership/OwnershipActions.java, src/test/java/net/tfminecraft/vehicleframework/data/RuntimeValuesCoverageTest.java, src/test/java/net/tfminecraft/vehicleframework/events/VehicleOwnerClaimedEventTest.java, src/test/java/net/tfminecraft/vehicleframework/managers/OwnershipManagerTest.java, src/test/java/net/tfminecraft/vehicleframework/managers/VehicleManagerCoverageTest.java, src/test/java/net/tfminecraft/vehicleframework/ownership/OwnershipActionsTest.java
The legacy event class, its claim dispatch and cancellation check, and its dedicated tests were removed. Ownership claim and takeover tests now check VehicleOwnershipChangeEvent.
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
size:M30-99 effective changed lines (tests excluded in mixed PRs).
1 participant
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.
Replace the legacy cancellable VehicleOwnerClaimedEvent with the existing VehicleOwnershipChangeEvent CLAIM pre-event and paired VehicleOwnershipChangedEvent. Cancellation still prevents every write and reports failure under the same operation ID. This intentionally removes a public event and must ship with the coordinated SimpleFactions modern guard/legacy bridge update.
Also fix the accepted TLibs 2.6.1 carryover: when SQLite rolls back an Error, VehicleRepository now restores both eager occupancy and tracked-car caches before rethrowing the original Error. Persisted formats, names mode, ownership authority, raw legacy records and migration/hold readers stay intact.
Validation:
Docs: TF-Minecraft/Docs#240
Deploy only with the reviewed SF counterpart after verified 6c Dev activation, in a stopped coherent cohort. If versions are split, upgrade SF first. Retain the complete 6c rollback set; no Main deployment.
Required SF guard counterpart: TF-Minecraft/SimpleFactions#166