fix(store): generate a unique id per Store instance#25
Merged
Conversation
The `id` parameter defaulted to `str(uuid4())`, a default argument
evaluated once at import time, so every Store created without an explicit
id shared the same UUID and overwrote the previous one in SuperStore —
routing all their /api/_store/{id}/* traffic to whichever registered
last. Default to None and generate the UUID inside __init__ so each
instance gets its own id.
Owner
|
LGTM. |
Az107
pushed a commit
that referenced
this pull request
Jul 5, 2026
LoboGuardian
added a commit
to LoboGuardian/HTeaLeaf
that referenced
this pull request
Jul 11, 2026
The develop branch renamed the package to lowercase htealeaf, exports the app class as HteaLeaf (the htealeaf factory alias is gone), removed enable_reactivity in favour of SuperStore(app) wiring, and dropped Store.react() — stores are now read server-side with .read() and the client re-renders via DOM reconciliation. Store ids are auto-generated per instance since Az107#25, so the explicit id workaround is unnecessary. Also marks async-first architecture done in the roadmap and notes the session TTL work on feature/alb-28.
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.
Problem
Store.__init__defaultsidtostr(uuid4()):Default arguments are evaluated once, at import time, so every
Storecreated without an explicitidreceives the same UUID. Each then registers under that same key inSuperStore.stores(add()overwrites), so two independent default-constructed stores collapse into one endpoint —/api/_store/{id}/*traffic for store A is served by whichever store registered last.Fix
Default
id=Noneand generate the UUID inside__init__:Verification
No API change; explicit ids still honored (incl.
AuthStore, which passesid=self._id).