Fixes issue 548 (an ask replaced by a newer one stays open on the operator's channel for good).
What was wrong
When a new ask has the About of an open one from the same asker, the router closes the old one as replaced. showClosed then left the old ask's own message open with no words (Answered empty, Cleared not set), as if the newer ask took that message over. It does not: the newer ask looks for its message under its own key and opens a record ask.<asker>.<new id>. The old record was never cleared, and its Telegram copy kept offering answers nobody takes (live: ask.claude-code.instr-69c68500303164f6, open since 09:49:36 UTC).
What changes (modules/messenger)
asks.goshowClosed: a replaced ask's own message is ended like any other ended ask: edited on every channel that showed it to "Replaced by a newer question · ", with " asked again about the same thing; that question is the one to answer.", its buttons gone, and the record cleared. A replaced ask shown on a condition's message is unchanged (the controller's newer ask takes that message over in place).
asks.goendLeftovers, run from the minute's sweepAsks: an ask's own message still open whose ask already ended (and whose ask record names that message) is ended the same way. This closes the live leftover on the first tick after delivery, with no hand step.
Review of #238: the owed mark is dropped when a record clears (holder.gocleared), and when an ask's own message is ended, so a restarted router never says a held message of something that already ended.
README: both said.
Tests (replaced_test.go)
TestAReplacedAsksMessageEndsWithIt: two asks with the same About from one asker leave exactly one open record (the newer one's), and the older one's message on Telegram and the desk is edited to say it was replaced, with no buttons.
TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick: a record left as the old code left it is ended on the next tick, its Telegram copy edited.
TestAClearedRecordOwesNothing: a cleared record carries no owed, in memory and in the state.
All three fail on main (open ask records: [ask.mesh-delivery.d-1 ask.mesh-delivery.d-2], the message of an ended ask is still open, a cleared record still owes "raised").
go vet, go test of the module pass; MESH_CHECK_MODULES=messenger sh merge-check.sh passes (words, agent-home, paths, deps, the module's tests; manifests not read locally: no manifest change).
Limits I chose
I chose ending the replaced message over taking it over in place: it is one path for every ended ask, and the newer ask's message is a fresh one that rings once. The phone shows the old message ended and the new one open.
The leftover sweep acts only on a record of origin ask whose ask record names it, so a condition's message is never ended by it.
No manifest change, no state migration. Merges cleanly with #178 (also messenger).
Reviewers' checklist
The tests fail without the fix; checks green.
After delivery, operator-channel.open no longer lists ask.claude-code.instr-69c68500303164f6, and its Telegram copy says replaced with no buttons.
A replaced ask on a condition's message still hands that message to the newer ask.
By fix-548@g14. Not merged.
Fixes issue 548 (an ask replaced by a newer one stays open on the operator's channel for good).
## What was wrong
When a new ask has the About of an open one from the same asker, the router closes the old one as replaced. `showClosed` then left the old ask's own message open with no words (`Answered` empty, `Cleared` not set), as if the newer ask took that message over. It does not: the newer ask looks for its message under its own key and opens a record `ask.<asker>.<new id>`. The old record was never cleared, and its Telegram copy kept offering answers nobody takes (live: `ask.claude-code.instr-69c68500303164f6`, open since 09:49:36 UTC).
## What changes (modules/messenger)
- `asks.go` `showClosed`: a replaced ask's **own** message is ended like any other ended ask: edited on every channel that showed it to "Replaced by a newer question · <headline>", with "<asker> asked again about the same thing; that question is the one to answer.", its buttons gone, and the record cleared. A replaced ask shown on a **condition's** message is unchanged (the controller's newer ask takes that message over in place).
- `asks.go` `endLeftovers`, run from the minute's `sweepAsks`: an ask's own message still open whose ask already ended (and whose ask record names that message) is ended the same way. This closes the live leftover on the first tick after delivery, with no hand step.
- Review of #238: the `owed` mark is dropped when a record clears (`holder.go` `cleared`), and when an ask's own message is ended, so a restarted router never says a held message of something that already ended.
- README: both said.
## Tests (`replaced_test.go`)
- `TestAReplacedAsksMessageEndsWithIt`: two asks with the same About from one asker leave exactly one open record (the newer one's), and the older one's message on Telegram and the desk is edited to say it was replaced, with no buttons.
- `TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick`: a record left as the old code left it is ended on the next tick, its Telegram copy edited.
- `TestAClearedRecordOwesNothing`: a cleared record carries no `owed`, in memory and in the state.
- All three fail on main (`open ask records: [ask.mesh-delivery.d-1 ask.mesh-delivery.d-2]`, `the message of an ended ask is still open`, `a cleared record still owes "raised"`).
- `go vet`, `go test` of the module pass; `MESH_CHECK_MODULES=messenger sh merge-check.sh` passes (words, agent-home, paths, deps, the module's tests; manifests not read locally: no manifest change).
## Limits I chose
- I chose ending the replaced message over taking it over in place: it is one path for every ended ask, and the newer ask's message is a fresh one that rings once. The phone shows the old message ended and the new one open.
- The leftover sweep acts only on a record of origin `ask` whose ask record names it, so a condition's message is never ended by it.
- No manifest change, no state migration. Merges cleanly with #178 (also messenger).
## Reviewers' checklist
- [ ] The tests fail without the fix; checks green.
- [ ] After delivery, `operator-channel.open` no longer lists `ask.claude-code.instr-69c68500303164f6`, and its Telegram copy says replaced with no buttons.
- [ ] A replaced ask on a condition's message still hands that message to the newer ask.
By fix-548@g14. Not merged.
A replaced ask's message was left open as if the newer ask took it over, but
the newer ask opens a message of its own, so the old one kept offering answers
nobody takes. It now ends on every channel with 'Replaced by a newer question',
and the minute's sweep ends any such message left from before. A record that
clears no longer keeps what a walk owed of it (the review of PR 238).
Deliverynovox/mesh-catalog@7e27259a64ac — delivered since 2026-10-12T12:13:12Z
Delivery plan — builds messenger → novox; no bus step
tier 0: messenger
novox: receives messenger
Machines
build-agent on ace: passed — carried by plan-1791805651201498587
messenger on novox: passed — healthy 1 times over 1m25s
messenger on the rest running it: sent
Transitions
2026-10-12 11:44 (new) → proposed (announced): novox/mesh-catalog#241's head announced
2026-10-12 11:47 proposed → checked (checked): the verdict names this commit
2026-10-12 11:47 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
2026-10-12 12:06 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
2026-10-12 12:06 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
2026-10-12 12:13 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says
The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.
<!-- mesh-delivery:view -->
**Delivery** `novox/mesh-catalog@7e27259a64ac` — **delivered** since 2026-10-12T12:13:12Z
**Delivery plan** — builds messenger → novox; no bus step
- tier 0: messenger
- novox: receives messenger
**Machines**
- build-agent on ace: passed — carried by plan-1791805651201498587
- messenger on novox: passed — healthy 1 times over 1m25s
- messenger on the rest running it: sent
**Transitions**
- 2026-10-12 11:44 (new) → proposed (announced): novox/mesh-catalog#241's head announced
- 2026-10-12 11:47 proposed → checked (checked): the verdict names this commit
- 2026-10-12 11:47 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
- 2026-10-12 12:06 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
- 2026-10-12 12:06 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
- 2026-10-12 12:13 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says
The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: messenger)
mesh/repo-check: PASS — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
Delivery plan — builds messenger → novox; no bus step
tier 0: messenger
novox: receives messenger
read by no module's build: modules/messenger/README.md, modules/messenger/cmd/messenger/replaced_test.go
Run by the build seat on g14 as build-1791805491182377521 (builds --log build-1791805491182377521).
--- the gate: messenger
messenger: ok, 7 tool(s), invokes seat:mesh-controller.conditions, seat:mesh-controller.root-free, seat:issue-tracker.tracking, keeps state open, sent, asks, identities, walks; WARNING: settings ask(s) for a setting and do(es) not say whether it is trusted, so it counts as trusted: set at the terminal alone; say "trusted" false where nothing trusts it (novox/hq issue 339)
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 1
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-12T11:40:33Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-12T11:40:33Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): messenger
notes:
- modules/messenger/README.md and modules/messenger/cmd/messenger/replaced_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok git.novox.be/novox/mesh-catalog/checks/words 0.004s
words: 12 retired words and 70 daemons' lines, none in the 43146 strings of 690 files
ok git.novox.be/novox/mesh-catalog/checks/agenthome 0.013s
agent-home: no archive and no file written into under the agent's home
ok git.novox.be/novox/mesh-catalog/checks/paths 0.006s
paths: no module names another's state on its machine (3 known, listed to go)
long-running resources without health: 69, as kept
ok git.novox.be/novox/mesh-catalog/checks/deps 0.255s
testing modules/messenger
ok messenger/cmd/messenger 2.171s
--- its merge-check-typescript.sh (typescript toolchain)
**Merge check** at `7e27259a`
- `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: messenger)
- `mesh/repo-check`: **PASS** — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
**Delivery plan** — builds messenger → novox; no bus step
- tier 0: messenger
- novox: receives messenger
- read by no module's build: modules/messenger/README.md, modules/messenger/cmd/messenger/replaced_test.go
Run by the build seat on g14 as `build-1791805491182377521` (`builds --log build-1791805491182377521`).
```
--- the gate: messenger
messenger: ok, 7 tool(s), invokes seat:mesh-controller.conditions, seat:mesh-controller.root-free, seat:issue-tracker.tracking, keeps state open, sent, asks, identities, walks; WARNING: settings ask(s) for a setting and do(es) not say whether it is trusted, so it counts as trusted: set at the terminal alone; say "trusted" false where nothing trusts it (novox/hq issue 339)
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 1
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-12T11:40:33Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-12T11:40:33Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): messenger
notes:
- modules/messenger/README.md and modules/messenger/cmd/messenger/replaced_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok git.novox.be/novox/mesh-catalog/checks/words 0.004s
words: 12 retired words and 70 daemons' lines, none in the 43146 strings of 690 files
ok git.novox.be/novox/mesh-catalog/checks/agenthome 0.013s
agent-home: no archive and no file written into under the agent's home
ok git.novox.be/novox/mesh-catalog/checks/paths 0.006s
paths: no module names another's state on its machine (3 known, listed to go)
long-running resources without health: 69, as kept
ok git.novox.be/novox/mesh-catalog/checks/deps 0.255s
testing modules/messenger
ok messenger/cmd/messenger 2.171s
--- its merge-check-typescript.sh (typescript toolchain)
```
An independent review, in a fresh clone. mesh/merge-gate passes (it builds messenger for novox, and 4 of 4 machines compose), and so does mesh/repo-check. go vet is clean, and go test -race -count=3 ./... in modules/messenger passes.
The tests fail without the fix
I ran replaced_test.go from 7e27259 on 3fe19c9, main before this branch, and all three tests fail there:
TestAReplacedAsksMessageEndsWithIt: replaced_test.go:43 finds two open ask records, d-1 and d-2.
TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick: replaced_test.go:87 finds d-1 still open.
TestAClearedRecordOwesNothing: replaced_test.go:106 and 109 find it still owes raised, in memory and in the state.
What I checked
A replaced ask's own message ends. In showClosed (asks.go:694-724), when the record is the ask's own (Origin == "ask"), the replaced case writes "Replaced by a newer question …". The message is edited where it was shown, and its buttons are gone. The record is cleared, and Owed is reset with it. If the message is still queued and not yet sent, resolve (outbox.go:273) drops it, because the record has cleared, so no stale question with buttons goes out later.
A condition's message is still taken over in place, not ended. The replaced case with !ownMessage keeps Answered empty and does not clear the record (asks.go:701-703). I checked this with a scratch probe, not committed: the condition owner asks d-1 on an open condition, then asks d-2 about the same condition.
The condition stays open, with Ask set to d-2 and Answered empty.
The copies on both the desk and Telegram are edited in place. The ticket behind their "Silence for a week" button belongs to d-2, not to d-1.
No ask record of its own is left open.
A second probe covered the mixed case: d-1 got a message of its own because the condition was not open yet, and d-2 is then shown on the condition. d-1's message ends, d-2 lives on the condition's message, and no ask message of its own stays open.
endLeftovers cannot end a live ask or a condition's message. It looks only at records with Origin == "ask" that are not cleared, whose ask is known, is not open, and names this record as its own (e.rec.Record == r.Key, asks.go:730-736). A live ask is open and is skipped. A condition's record is never Origin "ask". An ask this router has not loaded (e == nil) is left alone. Running showClosed again for one of these is harmless, because the record is cleared afterwards and the pass skips cleared records.
The operator cannot lose a question they can answer. The older ask is closed (asks.go:471-475) only after every refusal of the newer one has passed: its words, the open-asks limit and having a channel to carry it. Each newer ask keeps its own record key (ask.<asker>.<id>), so ending the older one never touches the newer one. The newer ask is then recorded, and either offered on the condition's message or given a message of its own through deliver. Ask messages are never held by a walk and never kept quiet, because needsNothing requires Origin "condition".
Owed is cleared in cleared() (holder.go:690) and when an ask's own message ends (asks.go:717). That settles the minor point in my review 42 of #238.
Minor (not blocking)
Between closeAsk(replaced) and CreateAsk there is a window, and this ordering was already there before this PR. If CreateAsk fails with anything but ErrChanged, the older message already says "Replaced by a newer question" while no newer ask is recorded yet. TakeAsk returns the error, so I expect the worker to redeliver the ask, and the new one is then created normally. I did not prove that redelivery. Closing the older ask only after the newer is recorded would remove the window.
Not merged by me.
Verdict: approve at 7e27259
An independent review, in a fresh clone. mesh/merge-gate passes (it builds messenger for novox, and 4 of 4 machines compose), and so does mesh/repo-check. `go vet` is clean, and `go test -race -count=3 ./...` in modules/messenger passes.
## The tests fail without the fix
I ran `replaced_test.go` from 7e27259 on 3fe19c9, main before this branch, and all three tests fail there:
- `TestAReplacedAsksMessageEndsWithIt`: replaced_test.go:43 finds two open ask records, d-1 and d-2.
- `TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick`: replaced_test.go:87 finds d-1 still open.
- `TestAClearedRecordOwesNothing`: replaced_test.go:106 and 109 find it still owes `raised`, in memory and in the state.
## What I checked
- **A replaced ask's own message ends.** In `showClosed` (asks.go:694-724), when the record is the ask's own (`Origin == "ask"`), the replaced case writes "Replaced by a newer question …". The message is edited where it was shown, and its buttons are gone. The record is cleared, and `Owed` is reset with it. If the message is still queued and not yet sent, `resolve` (outbox.go:273) drops it, because the record has cleared, so no stale question with buttons goes out later.
- **A condition's message is still taken over in place, not ended.** The replaced case with `!ownMessage` keeps `Answered` empty and does not clear the record (asks.go:701-703). I checked this with a scratch probe, not committed: the condition owner asks d-1 on an open condition, then asks d-2 about the same condition.
- The condition stays open, with `Ask` set to d-2 and `Answered` empty.
- The copies on both the desk and Telegram are edited in place. The ticket behind their "Silence for a week" button belongs to d-2, not to d-1.
- No ask record of its own is left open.
- A second probe covered the mixed case: d-1 got a message of its own because the condition was not open yet, and d-2 is then shown on the condition. d-1's message ends, d-2 lives on the condition's message, and no ask message of its own stays open.
- **endLeftovers cannot end a live ask or a condition's message.** It looks only at records with `Origin == "ask"` that are not cleared, whose ask is known, is not `open`, and names this record as its own (`e.rec.Record == r.Key`, asks.go:730-736). A live ask is `open` and is skipped. A condition's record is never `Origin "ask"`. An ask this router has not loaded (`e == nil`) is left alone. Running `showClosed` again for one of these is harmless, because the record is cleared afterwards and the pass skips cleared records.
- **The operator cannot lose a question they can answer.** The older ask is closed (asks.go:471-475) only after every refusal of the newer one has passed: its words, the open-asks limit and having a channel to carry it. Each newer ask keeps its own record key (`ask.<asker>.<id>`), so ending the older one never touches the newer one. The newer ask is then recorded, and either offered on the condition's message or given a message of its own through `deliver`. Ask messages are never held by a walk and never kept quiet, because `needsNothing` requires `Origin "condition"`.
- **`Owed` is cleared** in `cleared()` (holder.go:690) and when an ask's own message ends (asks.go:717). That settles the minor point in my review 42 of #238.
## Minor (not blocking)
- Between `closeAsk(replaced)` and `CreateAsk` there is a window, and this ordering was already there before this PR. If `CreateAsk` fails with anything but `ErrChanged`, the older message already says "Replaced by a newer question" while no newer ask is recorded yet. `TakeAsk` returns the error, so I expect the worker to redeliver the ask, and the new one is then created normally. I did not prove that redelivery. Closing the older ask only after the newer is recorded would remove the window.
Not merged by me.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes issue 548 (an ask replaced by a newer one stays open on the operator's channel for good).
What was wrong
When a new ask has the About of an open one from the same asker, the router closes the old one as replaced.
showClosedthen left the old ask's own message open with no words (Answeredempty,Clearednot set), as if the newer ask took that message over. It does not: the newer ask looks for its message under its own key and opens a recordask.<asker>.<new id>. The old record was never cleared, and its Telegram copy kept offering answers nobody takes (live:ask.claude-code.instr-69c68500303164f6, open since 09:49:36 UTC).What changes (modules/messenger)
asks.goshowClosed: a replaced ask's own message is ended like any other ended ask: edited on every channel that showed it to "Replaced by a newer question · ", with " asked again about the same thing; that question is the one to answer.", its buttons gone, and the record cleared. A replaced ask shown on a condition's message is unchanged (the controller's newer ask takes that message over in place).asks.goendLeftovers, run from the minute'ssweepAsks: an ask's own message still open whose ask already ended (and whose ask record names that message) is ended the same way. This closes the live leftover on the first tick after delivery, with no hand step.owedmark is dropped when a record clears (holder.gocleared), and when an ask's own message is ended, so a restarted router never says a held message of something that already ended.Tests (
replaced_test.go)TestAReplacedAsksMessageEndsWithIt: two asks with the same About from one asker leave exactly one open record (the newer one's), and the older one's message on Telegram and the desk is edited to say it was replaced, with no buttons.TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick: a record left as the old code left it is ended on the next tick, its Telegram copy edited.TestAClearedRecordOwesNothing: a cleared record carries noowed, in memory and in the state.open ask records: [ask.mesh-delivery.d-1 ask.mesh-delivery.d-2],the message of an ended ask is still open,a cleared record still owes "raised").go vet,go testof the module pass;MESH_CHECK_MODULES=messenger sh merge-check.shpasses (words, agent-home, paths, deps, the module's tests; manifests not read locally: no manifest change).Limits I chose
askwhose ask record names it, so a condition's message is never ended by it.Reviewers' checklist
operator-channel.openno longer listsask.claude-code.instr-69c68500303164f6, and its Telegram copy says replaced with no buttons.By fix-548@g14. Not merged.
Delivery
novox/mesh-catalog@7e27259a64ac— delivered since 2026-10-12T12:13:12ZDelivery plan — builds messenger → novox; no bus step
Machines
Transitions
The commit's note under
refs/notes/mesh-plankeeps every transition:git log --notes=mesh-plan.Merge check at
7e27259amesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: messenger)mesh/repo-check: PASS — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)Delivery plan — builds messenger → novox; no bus step
Run by the build seat on g14 as
build-1791805491182377521(builds --log build-1791805491182377521).Verdict: approve at
7e27259An independent review, in a fresh clone. mesh/merge-gate passes (it builds messenger for novox, and 4 of 4 machines compose), and so does mesh/repo-check.
go vetis clean, andgo test -race -count=3 ./...in modules/messenger passes.The tests fail without the fix
I ran
replaced_test.gofrom7e27259on3fe19c9, main before this branch, and all three tests fail there:TestAReplacedAsksMessageEndsWithIt: replaced_test.go:43 finds two open ask records, d-1 and d-2.TestAnAsksMessageLeftOpenAfterItsAskEndedIsEndedOnTheNextTick: replaced_test.go:87 finds d-1 still open.TestAClearedRecordOwesNothing: replaced_test.go:106 and 109 find it still owesraised, in memory and in the state.What I checked
showClosed(asks.go:694-724), when the record is the ask's own (Origin == "ask"), the replaced case writes "Replaced by a newer question …". The message is edited where it was shown, and its buttons are gone. The record is cleared, andOwedis reset with it. If the message is still queued and not yet sent,resolve(outbox.go:273) drops it, because the record has cleared, so no stale question with buttons goes out later.!ownMessagekeepsAnsweredempty and does not clear the record (asks.go:701-703). I checked this with a scratch probe, not committed: the condition owner asks d-1 on an open condition, then asks d-2 about the same condition.Askset to d-2 andAnsweredempty.Origin == "ask"that are not cleared, whose ask is known, is notopen, and names this record as its own (e.rec.Record == r.Key, asks.go:730-736). A live ask isopenand is skipped. A condition's record is neverOrigin "ask". An ask this router has not loaded (e == nil) is left alone. RunningshowClosedagain for one of these is harmless, because the record is cleared afterwards and the pass skips cleared records.ask.<asker>.<id>), so ending the older one never touches the newer one. The newer ask is then recorded, and either offered on the condition's message or given a message of its own throughdeliver. Ask messages are never held by a walk and never kept quiet, becauseneedsNothingrequiresOrigin "condition".Owedis cleared incleared()(holder.go:690) and when an ask's own message ends (asks.go:717). That settles the minor point in my review 42 of #238.Minor (not blocking)
closeAsk(replaced)andCreateAskthere is a window, and this ordering was already there before this PR. IfCreateAskfails with anything butErrChanged, the older message already says "Replaced by a newer question" while no newer ask is recorded yet.TakeAskreturns the error, so I expect the worker to redeliver the ask, and the new one is then created normally. I did not prove that redelivery. Closing the older ask only after the newer is recorded would remove the window.Not merged by me.