The GitHub Actions job "CI - Groovy Joint Validation Build" on grails-core.git/8.0.x-hibernate7.gorm-scaling-clean has failed. Run started by GitHub user borinquenkid (triggered by borinquenkid).
Head commit for run: 68af192470b4bf54e3ddf5992d6d1d778132c1c2 / Walter Duque de Estrada <[email protected]> fix: suppress spurious MongoDB updates when only auto-timestamps change Root cause: AutoTimestampEventListener.beforeUpdate() unconditionally sets lastUpdated/dateCreated on every PreUpdate event, even when the entity has no user-intent changes. This caused PendingUpdate.run() to see a changed property, add it to $set, and increment the optimistic-locking version — breaking the MarkDirtyFalseSpec contract that a no-op save() must not increment version. Fix in MongoCodecEntityPersister.persistEntity(): - Before cancelUpdate fires, capture a snapshot of all property values and whether the entity already had user-intent dirty state (hasPreExistingDirty). - After cancelUpdate, compare the snapshot to detect what changed. If the only changes are lastUpdated/dateCreated (auto-timestamp properties) with no pre-existing user-intent dirty state, restore those timestamps, call trackChanges(), and veto the update. - The veto condition requires onlyAutoTimestampChanged to be non-empty — entities without auto-timestamp properties (including those with embedded-only associations) are never incorrectly vetoed, even when the snapshot comparison misses embedded-object mutations (same object reference). - Also refactored persistEntity() to remove the unnecessary isUpdate && !session.isDirty(obj) early-return guard, which was incompatible with the snapshot logic. Other changes: - GrailsDataMongoTckManager: added GormRegistry.reset() in setup() for per-test datastore isolation (prevents stale GORM state polluting successive test features). - DirtyCheckingSupport: propagate dirty-checking into PersistentCollection items so collection-element mutations are visible to the parent entity's dirty check traversal. Tests verified: MarkDirtyFalseSpec, EmbeddedAssociationSpec, EmbeddedCollectionAndInheritanceSpec, EmbeddedCollectionWithOneToOneSpec, EmbeddedUnsetSpec, LastUpdatedSpec, BeforeUpdatePropertyPersistenceSpec, DirtyCheckUpdateSpec — plus full testSelected suite: 4588 tests, 0 failures. Report URL: https://github.com/apache/grails-core/actions/runs/26576075790 With regards, GitHub Actions via GitBox
