A module waits for a state created after it starts (issue 1790) #97

Merged
mesh-tools merged 4 commits from fix/1790-state-appears into main 2026-10-26 14:47:32 +00:00
Member

Issue 1790 (sixth instance, note of 2026-10-26 15:05). Group fix/1790-state-appears with mesh-delivery.

Since the grants part creates a manifest's buckets after a module's delivery, a module opening a new kept state at start got "bucket not found" and never looked again (mesh-delivery's checker and builder hearing: their dead_letters status stayed empty).

  • process.AwaitBucket: subscribes to $JS.EVENT.ADVISORY.STREAM.CREATED.KV_<bucket> first, then binds; while missing it says so once and binds when the advisory arrives or at its next use (no timer); Put keeps the latest value per key and returns ErrNotYet, the kept values are written before the bucket is handed on; Ready(f). A refused subscription (permissions violation naming the subject) is said loudly once; a reconnect subscribes again and tries a bind.
  • buildrun.SayHearing takes a HearingKeeper.
  • buscompose grants module and process principals a subscribe to the creation advisory of exactly the buckets they own or read (no wildcard).

Rule bent (said): TestTheCopiedComposerComposesAsTheControllers drops only the new advisory rows before comparing with the controller's composer, which is frozen and whose list the bus no longer loads since the take-over (14:58 today). A hand-back to the controller's list would drop only these subscriptions; buckets then bind at next use, as before.

The bus reloads its user list once when mesh-grants takes this (additions only: no connection drops; reviewed against nats-server reloadAuthorization).

Tests: subtests in TestReadAccountRefusesAFileMissingAField (missing, advisory, refused, reconnect), a row in TestStateCreateGetUpdateOnAGrantedBucket, rows in TestTheGrantsPartCreatesOnlyDeclaredStreams. Suites (-race on process) and vet clean. Try try-1793025049398030189 passed.

Reviewed-by: review-1790@shanks at 65ee43f075

Issue 1790 (sixth instance, note of 2026-10-26 15:05). Group fix/1790-state-appears with mesh-delivery. Since the grants part creates a manifest's buckets after a module's delivery, a module opening a new kept state at start got "bucket not found" and never looked again (mesh-delivery's checker and builder `hearing`: their dead_letters status stayed empty). - `process.AwaitBucket`: subscribes to `$JS.EVENT.ADVISORY.STREAM.CREATED.KV_<bucket>` first, then binds; while missing it says so once and binds when the advisory arrives or at its next use (no timer); `Put` keeps the latest value per key and returns ErrNotYet, the kept values are written before the bucket is handed on; `Ready(f)`. A refused subscription (permissions violation naming the subject) is said loudly once; a reconnect subscribes again and tries a bind. - `buildrun.SayHearing` takes a HearingKeeper. - buscompose grants module and process principals a subscribe to the creation advisory of exactly the buckets they own or read (no wildcard). Rule bent (said): TestTheCopiedComposerComposesAsTheControllers drops only the new advisory rows before comparing with the controller's composer, which is frozen and whose list the bus no longer loads since the take-over (14:58 today). A hand-back to the controller's list would drop only these subscriptions; buckets then bind at next use, as before. The bus reloads its user list once when mesh-grants takes this (additions only: no connection drops; reviewed against nats-server reloadAuthorization). Tests: subtests in TestReadAccountRefusesAFileMissingAField (missing, advisory, refused, reconnect), a row in TestStateCreateGetUpdateOnAGrantedBucket, rows in TestTheGrantsPartCreatesOnlyDeclaredStreams. Suites (-race on process) and vet clean. Try try-1793025049398030189 passed. Reviewed-by: review-1790@shanks at 65ee43f07583e12a4d4aa45e5fbb120ae8935300
mesh-tools added 4 commits 2026-10-26 14:40:54 +00:00
Since the grants part creates a manifest's buckets after a delivery (ADR 0547), a module restarted by that
delivery can open a new state before it exists; OptionalBucket answered nil and the part never looked again
(mesh-delivery's checker and builder, state hearing, 2026-10-26). AwaitBucket binds on the server's
STREAM.CREATED advisory, or at the next use, and writes the latest value kept per key. The copied composer's
agreement test leaves that one row out: the controller's list is no longer loaded since the take-over.
Merge remote-tracking branch 'origin/main' into fix/1790-state-appears
mesh/delivery merged: source.main moved to novox/mesh-sdk@a7a1fbd34e1d
mesh/delivery-group group fix/1790-state-appears merged: every member is merged
mesh/check being carried to 65ee43f07583 on a7a1fbd34e1d | from 1888d1d230b3, mesh-delivery feef96ed160e
65ee43f075
Author
Member

Delivery novox/mesh-sdk@65ee43f07583 — merged since 2026-10-26T14:47:34Z

Source — source.main moved to novox/mesh-sdk@a7a1fbd34e. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Group fix/1790-state-appears: novox/mesh-delivery@fcb1e40582, novox/mesh-sdk@65ee43f075

Transitions

  • 2026-10-26 14:40 (new) → proposed (announced): novox/mesh-sdk#97's head announced
  • 2026-10-26 14:40 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-10-26 14:47 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-sdk@65ee43f07583` — **merged** since 2026-10-26T14:47:34Z **Source** — source.main moved to novox/mesh-sdk@a7a1fbd34e1d. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Group** `fix/1790-state-appears`: novox/mesh-delivery@fcb1e4058262, novox/mesh-sdk@65ee43f07583 **Transitions** - 2026-10-26 14:40 (new) → proposed (announced): novox/mesh-sdk#97's head announced - 2026-10-26 14:40 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-10-26 14:47 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
Author
Member

mesh-delivery: the operator's Approve of this pull request's merge into main is ended: a head it covers moved on: the heads it covers are no longer the group's heads. Nothing is merged on it. The operator is asked again once the checks pass at the new head.

mesh-delivery: the operator's Approve of this pull request's merge into main is ended: a head it covers moved on: the heads it covers are no longer the group's heads. Nothing is merged on it. The operator is asked again once the checks pass at the new head.
mesh-tools merged commit a7a1fbd34e into main 2026-10-26 14:47:32 +00:00
mesh-tools deleted branch fix/1790-state-appears 2026-10-26 14:47:32 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-sdk#97