fix(orm): honor polymorphic write lifecycle (F07) - #240
Merged
Merged
Conversation
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.
Variant updates and deletes bypassed the ordinary lifecycle pipeline, so soft-deletable polymorphic entities were physically removed and hooks/timestamps were skipped. This change makes explicit
ofVariant()writes and tracked polymorphicsaveChanges()use one atomic pipeline for STI and CTI.restore()andhardDelete()with typed return values.The coordinated v5 major changeset and migration guide explain the deletion change: consumers requiring physical removal must use
hardDelete().Validation:
npm run lint,npm run build,npm run test(4,721 tests, no type errors), both website typechecks, andnpm run test:queries:integrationagainst PostgreSQL 16 (85 tests, including 26 F07 regressions). Coverage includes STI/CTI lifecycle behavior, tracked inserts/updates/deletes, savepoint/outer rollback, FK and hook failures, scopes/pagination, stale versions, concurrent predicate changes, exact bigint keys, and write-surface type checks.