Skip to content

Backdate set-up positions so a write under test changes a stored value - #586

Open
silverbackdan wants to merge 2 commits into
mainfrom
fix/585-next-component-positions
Open

silverbackdan wants to merge 2 commits into
mainfrom
fix/585-next-component-positions

Conversation

@silverbackdan

Copy link
Copy Markdown
Collaborator

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/orm held at 3.7.3 passes, and swapping ORM's src between that commit and its parent (e635772d) flips the result.

Until 3.7, UnitOfWork::computeChangeSet() compared object fields by identity. TimestampedDataPersister sets modifiedAt to a new \DateTime on every API write, so every write was an UPDATE. From 3.8 the ORM compares the values the column would store. modifiedAt is a datetime (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, so PropagateUpdatesListener neither 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 is modifiedAt, 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' modifiedAt an 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.
  • CLAUDE.md records the trap; CHANGELOG has a Tooling line.

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

#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

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (d0436eb) to head (424eac7).

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           
Flag Coverage Δ
phpunit 97.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symfony NEXT (8.2-dev) leg: two component position tests fail

1 participant