Repository navigation
fix(refresh): replace stale attribute cast caches - #367
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.
refresh()can retain a previously cached cast after the database value changes. A Boolean loaded as null stays null even after a refresh reads 1; object casts can likewise return their old values.Replace the cast-cache map when applying refreshed attributes. Hydrated reads retain their freshly cast objects and normal hydration hooks; projection snapshots rebuild casts from their raw values. The map is shallow-copied so refresh does not duplicate object graphs or share the mutable cache container.
Adds regression cases for nullable Boolean transitions, JSON object casts, and projected refresh snapshots. The focused Lucee 6/MySQL run passes all 27 cast and snapshot specs. Running those same cases against the previous implementation produces one failure and two errors; restoring the patch returns all 27 to green. All 26 PR jobs and all 24 release jobs passed, including the engine matrix. Quick 13.0.6 is published; a fresh ForgeBox install confirmed its BaseEntity source matches the tested merge commit.