You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 30ec243
Browse filesBrowse the repository at this point in the historyBrowse files
fix(approvals): "ended" is judged by the flow body the run ran, not today's
The read holds only the flow body armed now. A run that started a subflow,
whose flow was later edited to drop it, was judged by the edit and served
"the approval ended here". "Ended" now also needs the run to have provably
run the armed body: that body is the flow's newest registration (the engine's
version history, the very object) and was registered strictly before the run
started. An edit, a rollback or a restart's re-registration since the run
started leaves "ended" unclaimed. The run's flowVersion is not the witness:
an edit need not change the author's number.
The contract, changeset and approvals docs say which body is judged; the
child-run node list names the two executors that set $parentRunId.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn
Copy file name to clipboardExpand all lines: .changeset/35863-decided-route-outcome.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The single approval request read (`GET /api/v1/approvals/requests/ID`) serves on
15
15
16
16
-`outcome.step` is the run's latest request when it is a later one than this request (a request of the same flow run opened after it, on any node, a later round of the same node included; a pending one wins over a decided one). It is absent when no later request was opened in that run; a request a child run opened is not among them.
17
17
-`outcome.status` is that latest request's status, or this request's own when `step` is absent. `pending` with a `step` means the approval went on to that step and waits on its decision.
18
-
-`outcome.ended` is `true` only when the record's approval is known to have stopped: the request's run is a root run (not a `subflow` body or a `map` item, whose end is not the approval's), its flow holds no `subflow` or `map` node anywhere, regions included (a child run files its requests under its own run, so this run's requests cannot show what it decided, before or after this request), and the run reports it stopped for good, with the same terminal set the dead-run sweep uses. `false` means not known to have stopped: the run goes on, is a child run, runs a flow that can start a child run, cannot be read, or was opened before this release (the approval node now records on each new request whether its run is a root run).
18
+
- `outcome.ended` is `true` only when the record's approval is known to have stopped: the request's run is a root run (not a `subflow` body or a `map` item, whose end is not the approval's), the flow body the run ran holds no `subflow` or `map` node anywhere, regions included (a child run files its requests under its own run, so this run's requests cannot show what it decided, before or after this request), and the run reports it stopped for good, with the same terminal set the dead-run sweep uses. The body the run ran is known only when the body armed now is the flow's newest registration and was registered before the run started, so a flow edited, rolled back or re-registered after a run started is never judged by its current body for that run. `false` means not known to have stopped: the run goes on, is a child run, ran a body that can start a child run, ran a body that is not known, cannot be read, or was opened before this release (the approval node now records on each new request whether its run is a root run).
19
19
20
20
`outcome` is absent when nothing past the request is known: no later request was opened and the approval is not known to have ended, or several later requests are pending at once (parallel steps). A pending request's route never carries it. It is served to every reader of the request and says only where the same approval went: the later step's node id and label and that request's status, never the later request's id, approvers, comments or field values. The `ApprovalRequestRow.flow_route` contract type in `@objectstack/spec/contracts` gains the optional member, and `routeOutcome` in `@objectstack/plugin-approvals` is the rule.
0 commit comments