Repository navigation
Backdate set-up positions so a write under test changes a stored value - #586
Open
silverbackdan wants to merge 2 commits into
Open
silverbackdan wants to merge 2 commits into
silverbackdan wants to merge 2 commits into
Conversation
#585) Doctrine ORM 3.8 (doctrine/orm#12753) compares the database values of object fields, so a position write whose only change is modifiedAt in the same second as set-up is no longer an update and is neither purged nor published.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #586 +/- ##
=========================================
Coverage 97.09% 97.09%
Complexity 5350 5350
=========================================
Files 438 438
Lines 13837 13837
=========================================
Hits 13435 13435
Misses 402 402
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Fixes #585
Cause
doctrine/orm 3.8.x-dev, commit 13ed8ade (doctrine/orm#12753, "Compare database values to detect unchanged object fields"). Bisected on the NEXT leg's dependencies: everything at dev with only
doctrine/ormheld at 3.7.3 passes, and swapping ORM'ssrcbetween that commit and its parent (e635772d) flips the result.Until 3.7,
UnitOfWork::computeChangeSet()compared object fields by identity.TimestampedDataPersistersetsmodifiedAtto a new\DateTimeon every API write, so every write was an UPDATE. From 3.8 the ORM compares the values the column would store.modifiedAtis adatetime(second precision), so a write in the same second as the stored value, with no other field changed, is not an update: nothing is flushed, soPropagateUpdatesListenerneither purges nor publishes it.Both tests write position C (
before: A), which the orderer keeps at sortValue 2 (C2 A3 B4). C's only change ismodifiedAt, and set-up ran in the same second, so C was not purged (ComponentGroupOrderTest) or published (ComponentMoveTest). With a one-second gap both pass on ORM 3.8.This is an intended ORM change (documented in its UPGRADE.md), not a regression. The bundle's behaviour is correct: the stored row really is identical, so no cache or subscriber holds stale data.
Change
ComponentSiteTrait::createGroupWithPositions()sets the created positions'modifiedAtan hour earlier, so a write under test always changes a stored value, as content written earlier than an edit does in practice. No expected value changes.Test-only: no
src/lines change, so the Infection PR gate has no mutants.Verified locally: full suite (
paratest -p4, 5809 tests) green on the NEXT leg's dev dependencies (Symfony 8.2.x-dev, ORM 3.8.x-dev) and on the stable lock.🤖 Generated with Claude Code