Skip to content

Encapsulate lazy session persistence. - #93

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
encapsulate-session-values
Aug 17, 2026
Merged

Encapsulate lazy session persistence.#93
samuel-williams-shopify merged 1 commit into
mainfrom
encapsulate-session-values

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Remove public access to the mutable hash underlying Utopia::Session::LazyHash.

Make load! private and replace the raw values accessor with an explicit persist lifecycle. Persistence now checks whether an update is required, updates updated_at, yields the internal values for immediate serialization, and only clears the changed state after successful persistence.

This avoids copying the session hash while preventing accidental mutation through general-purpose accessors. Tests cover successful persistence, failed persistence, timestamp updates, and accessor visibility.

Assisted-By: devx/cbdeae41-9308-4071-ad53-58cd92db2946
@samuel-williams-shopify samuel-williams-shopify changed the title Encapsulate lazy session values. Encapsulate lazy session persistence. Aug 17, 2026
@samuel-williams-shopify
samuel-williams-shopify merged commit 16a76eb into main Aug 17, 2026
36 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the encapsulate-session-values branch August 17, 2026 07:21
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