Skip to content

fix(refresh): replace stale attribute cast caches - #367

Merged
elpete merged 3 commits into
mainfrom
fix/refresh-cast-cache
Oct 15, 2026
Merged

elpete merged 3 commits into
mainfrom
fix/refresh-cast-cache

Conversation

@elpete

@elpete elpete commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@elpete
elpete merged commit 39432e8 into main Oct 15, 2026
52 of 79 checks passed
@elpete
elpete deleted the fix/refresh-cast-cache branch October 15, 2026 21:24
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.

1 participant