fix(admin): decouple remote commands from HTTP requests - #4483
Conversation
|
@wilhel1812 — an explanation is owed here, and the short version is that this PR was preempted by my mistake. What happenedYou reported the bug with browser network logs and host-level I started implementing at roughly the same time and opened #4485 at 14:28Z — 45 minutes after this one — without checking whether a PR already existed against the issue. It merged first, followed by #4486 for the remaining blocking endpoints ( Your work is not discardedThe two implementations converged on the same design — 202 + an in-memory operation registry with stable error codes, client polling, local-node commands staying synchronous, no new UI. Where they differ, yours was ahead in two places: Documentation. Mine shipped with none. Yours documented the async contract, the lifecycle, the retention window, and the confirmation semantics. That is ported in #4490, adapted to the endpoint and error-code names that shipped, with a Your status model is better than what shipped. Surfacing Leaving this open for nowI am not closing it while #4490 is still unmerged — if that PR is rejected or reworked, your prose here is the source of record. Once #4490 lands, this can be closed with a link to it and to #4492. Sorry for the wasted effort. The concrete change on my side is checking for open PRs against an issue before writing code for it. |
Summary
202 Acceptedfor validated remote admin commands and execute passkey acquisition/transmission outside the Express request lifecycle200behavior for local-node commands and add no new UIRoot cause
A remote admin request could synchronously spend up to 45 seconds acquiring a session passkey and then another 30 seconds awaiting a routing ACK. Holding the HTTP request open for that mesh work made otherwise valid commands vulnerable to proxy/origin disconnects and HTML
502responses.API compatibility
200response.202with an operation snapshot.GET /api/admin/commands/:operationIduntil a terminal result, so existing control disabling, command sequencing, and toast behavior are preserved.Validation
Passed:
npm run lint:cinpm run typechecknpm run buildnpm run build:servernpm run docs:buildRepository baselines observed locally:
npm run lintreports the existing raw-lint baseline (2,275 findings); the enforced lint ratchet passes and improves touched-file counts.npm run typecheck:testsreports 405 existing test-type errors, with none in files changed by this PR.npm run test:runcompleted 12,917 passing tests and reported eight failures in unrelated MeshCore virtual-node timing and link-preview URL-validation tests. The same two files remain reproducibly failing when run alone in this local Node 25 environment; no code in those paths is changed here.Fixes #4482