Skip to content

Commit e546847

Browse files
committed
docs(runtime): name the both-disabled shared-name exception at the clone door, and the POST / credential carry
Prose only, no code path moves (review#1 delta record 6915149305, S5 option 1, N2): the clone door's comment and the #34145 changeset state that a name two packages hold with both holders disabled is not taken at the clone door, as on main; both changesets name POST /automation onto a held name beside PUT as the doors that keep a stored credential. Claude-Session: https://claude.ai/code/session_01FEkQ5kgF3mo9f7LXuv5hac Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e6f54de commit e546847

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎.changeset/33905-disabled-sole-holder-flow.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ What moves, for such a flow, while its package is disabled:
1818
- `getFlow(name)` answered the flow. It now answers `null`, so the bare HTTP doors that ask it first (`GET /automation/NAME`, `POST /automation/NAME/trigger`, `POST /automation/trigger/NAME`, `POST /automation/NAME/toggle`, `POST /automation/NAME/clone`, `GET /automation/NAME/runs`) answer `404`, which is what the namespaced address `/automation/NAMESPACE/NAME…` already answered.
1919
- `toggleFlow(name, …)` switched the flow. It now rejects with `Flow 'NAME' not found`.
2020

21-
The HTTP write doors that ask a lasting question of the name do not move with it: the clone door's taken-name check on the new name, the definition a refused `POST /automation` or `PUT /automation/NAME` puts back, the stored credential a `PUT` body that leaves it out keeps, and the `DELETE /automation/NAME` existence check read the flow the engine holds whatever its package's enable state. For such a flow the clone's new name is refused `409`, the held definition is put back, the credential is kept and `DELETE` answers a deletion, as before this release. A name two packages hold is read at those doors on its served holder, as the bare entries read it.
21+
The HTTP write doors that ask a lasting question of the name do not move with it: the clone door's taken-name check on the new name, the definition a refused `POST /automation` or `PUT /automation/NAME` puts back, the stored credential a `PUT /automation/NAME` body, or a `POST /automation` body onto a name the engine holds, keeps when it leaves it out, and the `DELETE /automation/NAME` existence check read the flow the engine holds whatever its package's enable state. For such a flow the clone's new name is refused `409`, the held definition is put back, the credential is kept and `DELETE` answers a deletion, as before this release. A name two packages hold is read at those doors on its served holder, as the bare entries read it.
2222

2323
Remedy: enable the package. Its flow runs on its trigger again with no re-arm, and the bare entries serve it again.
2424

‎.changeset/34145-write-doors-durable-read.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ Metadata-protocol: none
1010

1111
**Added:** `AutomationEngine.getHeldFlow(name)` on `@objectstack/service-automation`: the flow the engine holds under a bare name, judged over every holder (a disabled package's included, `null` for a name it does not hold or a slot-key spelling); a name two packages hold is refused `409` naming every holder. Like `getFlow`, it settles the name first, so a lone qualified slot of a name one package holds again is re-keyed to the bare name.
1212

13-
Four `/automation` write doors ask a lasting question of a flow name: the clone door's taken-name check on the new name, the copy a refused definition write (`POST /`, `PUT /automation/NAME`) puts back, the credential `PUT /automation/NAME` keeps when the body leaves it out, and the `DELETE /automation/NAME` existence check. They read the engine's served view (`getFlow`), in which a flow whose one package is disabled is no flow. For a name one package holds they now read the flow the engine holds over every holder, through `getHeldFlow`, so their answers no longer depend on whether that package is enabled. For a flow whose only package is disabled while the engine still holds it:
13+
Four `/automation` write doors ask a lasting question of a flow name: the clone door's taken-name check on the new name, the copy a refused definition write (`POST /`, `PUT /automation/NAME`) puts back, the credential `PUT /automation/NAME`, or `POST /automation` onto a name the engine already holds, keeps when the body leaves it out, and the `DELETE /automation/NAME` existence check. They read the engine's served view (`getFlow`), in which a flow whose one package is disabled is no flow. For a name one package holds they now read the flow the engine holds over every holder, through `getHeldFlow`, so their answers no longer depend on whether that package is enabled. For a flow whose only package is disabled while the engine still holds it:
1414

1515
- Clone with this flow's name as the new name: refused `409`, the door's name-taken answer, and nothing is registered. Before, the copy was admitted and filed in the disabled package's slot.
1616
- A definition write the engine accepts and the store then refuses: the flow the engine held is registered again. Before, the name was withdrawn.
17-
- `PUT` with a body that leaves out a stored credential: the stored credential is kept. Before, nothing was carried forward.
17+
- `PUT`, or `POST /` onto the name, with a body that leaves out a stored credential: the stored credential is kept. Before, nothing was carried forward.
1818
- `DELETE`: the flow is removed and the door answers a deletion. Before, the door removed it and answered `404`.
1919

2020
These are the answers the last release gave: the served view changed after it.
2121

22-
A name two packages hold is read at these doors on its served holder, as before: a refused definition write puts back the served holder's body, and a `PUT` keeps the served holder's stored credential. With one holder disabled, a package-less `PUT /automation/NAME` or `POST /automation` onto such a name is admitted into the enabled holder, with or without a metadata store (the store's save, naming no package, writes the enabled holder's row), as before. While both holders are enabled, the definition writes and `DELETE` are refused `409` (`RESOURCE_CONFLICT`) naming every holder, as before.
22+
A name two packages hold is read at these doors on its served holder, as before: a refused definition write puts back the served holder's body, and a `PUT`, or a `POST /` onto the name, keeps the served holder's stored credential. With one holder disabled, a package-less `PUT /automation/NAME` or `POST /automation` onto such a name is admitted into the enabled holder, with or without a metadata store (the store's save, naming no package, writes the enabled holder's row), as before. While both holders are enabled, the definition writes and `DELETE` are refused `409` (`RESOURCE_CONFLICT`) naming every holder, as before.
2323

24-
The clone door's new name: a name two packages hold is taken. While one holder is disabled it gets the door's name-taken `409`, as before. While both are enabled, the engine's refusal used to leave the door thrown, naming every holder; the door now answers its own name-taken refusal, returned, with the same status and code (`409`, `RESOURCE_CONFLICT`), whose remedy is a new name.
24+
The clone door's new name: a name two packages hold is taken. While one holder is disabled it gets the door's name-taken `409`, as before. While both are enabled, the engine's refusal used to leave the door thrown, naming every holder; the door now answers its own name-taken refusal, returned, with the same status and code (`409`, `RESOURCE_CONFLICT`), whose remedy is a new name. One exception, as before: a name two packages hold with both holders disabled is not taken at the clone door (no holder is served, so the door finds no flow there) and the copy is admitted.
2525

2626
A flow of an enabled package, and a name the engine does not hold, answer as before. The read and run doors (`GET`, trigger, toggle, runs, the clone's source) keep the served view.

‎packages/runtime/src/domains/automation.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4542,7 +4542,11 @@ export async function handleAutomationRequest(deps: DomainHandlerDeps, path: str
45424542
// when two holders are served, the read's refusal, caught into
45434543
// this door's own taken-name answer as the store's is
45444544
// (`flowWriteRefusal`'s clone arm). The remedy is a NEW name,
4545-
// not a package.
4545+
// not a package. The one exception, as on `main` (seat ruling
4546+
// 6911640332, M1 = B): a name two packages hold with BOTH
4547+
// holders disabled is NOT taken here. `getHeldFlow` refuses
4548+
// the shared name, the served fallback `getFlow` answers
4549+
// `null` (no holder is served), and the copy is admitted.
45464550
const readHeld = heldFlowReader(automationService);
45474551
const collision = readHeld === undefined ? null : await cloneTargetHeld(readHeld, targetName);
45484552
if (collision) {

0 commit comments

Comments
 (0)