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 f381e8f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-automation): the flow toggle records which admin switched a packaged flow
The flow toggle door now hands `toggleFlow` its caller (`{ userId }`, the
contract's `caller`), and the automation engine writes the
`sys_metadata_activation` row under that user, elevated, through the store's
`setActive(row, { context })` channel. The engine stamps created_by and
updated_by from it and the audit plugin records the same id, so both rows
name the administrator. Only the id crosses; with no caller the write stays
unattributed. The dogfood actor file gains the flow door's case.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pwL1eE2BziiUM28wm
fix(service-automation): switching a packaged flow off now records which administrator did it
7
+
8
+
Clause-②: yes (widening)
9
+
Metadata-protocol: none
10
+
11
+
The flow toggle (`POST /api/v1/automation/:name/toggle`) writes a row in the activation ledger (`sys_metadata_activation`). Until now, that row and its audit entry named nobody: `created_by` / `updated_by` on the ledger row and `user_id` / `actor` on the `sys_audit_log` row were null, even when a signed-in administrator made the request. The action and security catalog doors were fixed in the previous release; the flow door reaches the ledger through `IAutomationService.toggleFlow`, which could not carry the caller until its `caller` parameter landed.
12
+
13
+
-`@objectstack/runtime`: the flow toggle door passes `toggleFlow(name, enabled, { userId })`, the signed-in user's id and nothing else.
14
+
-`@objectstack/service-automation`: `AutomationEngine.toggleFlow(name, enabled, caller?)` implements the contract's `caller`. The ledger write runs as that user, elevated and with no positions or permissions, so the engine and the audit plugin record the user's id on both rows. Only `userId` is read from `caller`. With no caller, or a caller without an id, the write stays unattributed, as before. `FlowActivationStore.setActive(row, options?)` takes the same optional `{ context }` as the shared activation store in `@objectstack/core`; a store that ignores it keeps working.
0 commit comments