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 e814dd1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cloud-connection): an install-local uninstall withdraws the package's flows from the automation engine at once, and unbinds their triggers
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
`DELETE /api/v1/marketplace/install-local/:manifestId` withdrew the package from the registry and ran its uninstall cleanups, but never told the running kernel. The automation engine withdraws a flow only when it re-syncs on `metadata:reloaded`, so the uninstalled package's flows stayed registered: `GET /api/v1/meta/flow/NAME` answered 404 while `GET /api/v1/automation/NAME` still answered `active`, `POST /api/v1/automation/NAME/trigger` still ran the flow and wrote a run row, and its record and schedule triggers stayed armed. That lasted until some unrelated reload, such as a view publish or another package's install. The door's note said the package was withdrawn from the running kernel.
11
+
12
+
- **Now.** After the registry withdrawal and the cleanups, the door announces `metadata:reloaded` with `{ changed: ['app/MANIFEST_ID'] }`, the same signal the install door's hot load announces. The engine's re-sync withdraws every flow it had armed that the package no longer provides and unbinds each one's trigger. Right after the `DELETE` returns, `GET /api/v1/automation/NAME` and its trigger door answer 404, and a write to a watched object runs nothing.
13
+
- **When the re-sync does not run.** If a subscriber throws, or the kernel context cannot announce, the uninstall still answers 200, and `cleanups` carries one failed outcome named `metadata:reloaded`. The note then says the engine can still hold the package's flows until the next restart. The cause goes to the operator log at `warn`, with the restart as the remedy.
14
+
- **Unchanged.** Nothing is announced when the uninstall did not happen (a refused caller, an id this door never installed, a ledger write that failed), or when the registry refused the withdrawal, because the package is still registered.
@@ -2308,13 +2333,81 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
2308
2333
cleanups,
2309
2334
note: withdrawal
2310
2335
? 'Cached manifest removed, and the uninstall cleanups this runtime\'s plugins registered ran — each one\'s outcome is in `cleanups`. The running kernel did not withdraw the package, so it stays loaded until the next restart; that is the `registry.uninstallPackage` entry in `cleanups`.'
2311
-
: copies
2312
-
? 'Cached manifest removed, the package withdrawn from the running kernel\'s registry, and the uninstall cleanups this runtime\'s plugins registered ran — each one\'s outcome is in `cleanups`. The metadata service kept copies of the package\'s objects, so the object listing and reads keep serving them until the next restart; that is the `metadata.unregister` entry in `cleanups`.'
2336
+
: copies || resync
2337
+
? 'Cached manifest removed, the package withdrawn from the running kernel\'s registry, and the uninstall cleanups this runtime\'s plugins registered ran — each one\'s outcome is in `cleanups`.'
2338
+
+ (copies
2339
+
? ' The metadata service kept copies of the package\'s objects, so the object listing and reads keep serving them until the next restart; that is the `metadata.unregister` entry in `cleanups`.'
2340
+
: '')
2341
+
+ (resync
2342
+
? ' The running kernel\'s re-sync did not run, so the automation engine can still hold the package\'s flows — triggerable by name, their triggers armed — until the next restart; that is the `metadata:reloaded` entry in `cleanups`.'
2343
+
: '')
2313
2344
: 'Cached manifest removed, the package withdrawn from the running kernel, and the uninstall cleanups this runtime\'s plugins registered ran — each one\'s outcome is in `cleanups`.',
2314
2345
},
2315
2346
}, 200);
2316
2347
};
2317
2348
2349
+
/**
2350
+
* [#27395] Announce an uninstall this door just completed to the running
2351
+
* kernel as `metadata:reloaded` — the re-sync signal
2352
+
* {@link announceHotInstall} announces for an install, with the same
2353
+
* payload — so every consumer that holds what it read from a package
2354
+
* re-reads a kernel that no longer has it:
2355
+
*
2356
+
* - `service-automation` re-syncs its flows from the protocol
2357
+
* (`resyncFlowsFromProtocol`) and withdraws each flow it armed that the
2358
+
* protocol's view no longer lists — the uninstalled package's, which
2359
+
* the registry withdrawal took out of that view — and `withdrawFlow`
2360
+
* unbinds each one's record or schedule trigger in the same step.
2361
+
*
2362
+
* Before this, the door withdrew the package from the registry and the
2363
+
* engine never heard of it: `GET /meta/flow/NAME` answered 404 while
2364
+
* `GET /automation/NAME` still answered `active`, and the trigger door, a
2365
+
* record write or a schedule still ran the uninstalled package's flow
2366
+
* until an unrelated reload — a view publish, another package's install —
2367
+
* cleared it. ⛔ No engine-side list of the package's flows is kept or
2368
+
* withdrawn here: a second teardown is how the two would drift.
2369
+
*
2370
+
* Never throws: the uninstall has already happened. Two answers:
2371
+
* - `undefined` — announced, and every subscriber returned;
2372
+
* - one failed outcome named {@link KERNEL_RESYNC}, when the context
2373
+
* cannot announce or a subscriber threw. It rides on `cleanups`, the
2374
+
* way a refused registry withdrawal does, and the operator log says
2375
+
* what it costs and the remedy; the cause is logged, never put on the
2376
+
* wire. A FUNCTIONAL degradation, so `warn` — the level the install's
0 commit comments