codeconsole commented on PR #16297: URL: https://github.com/apache/grails-core/pull/16297#issuecomment-5544072533
Round 2 addressed, two isolated commits. **`41b9230` — the ObjectId default now applies to the codec engine only.** Findings 1-3 are all the same shape: the mapping engine builds its flush-time update and delete filters from the declared identifier, and writes association references and DBRef `$id` values the same way. Rather than convert those paths piecemeal, this takes the alternative offered in round 1 and scopes the default to the engine that implements it end to end. The mapping engine keeps the pre-8.0.0 behaviour exactly, so there is nothing half-converted about it. Scoping affects the *default* only: an application that explicitly sets `defaultStoredAs` still gets what it asked for on either engine, with the same caveats it has today. This also reverts the partial mapping-engine `_id` coercion I added last round. You were right that fixing insert and point-read while update, delete and association writes stayed uncoerced left that engine in a worse place than not touching it. `MappingEngineStringIdStorageSpec` is replaced by three cases in `StringIdDefaultStoredAsConfigSpec` covering codec-gets-the-default, mapping-does-not, and explicit-still-honoured. **`4563be7` — `updateAll` normalises into a copy of the caller's map.** Correct on the defect, and it is worth noting it is not a regression: the line before this branch was already `properties.put(associationName, association.associatedEntity.reflector.getIdentifier(value))`, so the caller's map was being mutated then too, and an unmodifiable argument already threw. What changed is *what* gets written back, which makes the mutation more surprising. Copied now either way, with cases for both the mutation and the `Collections.singletonMap` argument, each verified to fail without the copy. `grails-data-mongodb-core` is at parity with `8.0.x` locally - the two `MongoDatastoreLifecycleSpec` failures reproduce on an unmodified checkout here. checkstyle and codenarc clean. One note on the round-2 verification section: a run that exceeds a local timeout without printing a result is not evidence of passing. I mention it only because the same caveat appeared in round 1 and the conclusion happened to hold both times. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
