[skip ci] wip: preserve Hermes crank development checkpoint

Owner-authorized recovery of accumulated source changes.
Includes accepted work and in-progress changes; NOT a release or acceptance.
Parent baseline 1b6db09bd1. Runtime data, build caches and local credentials excluded.
This commit is contained in:
Hermes DevOps committed 2026-10-25 10:00:22 +00:00
1 parent 1b6db09bd1
commit 75fe5a123c
357 files changed
+118831 -5113

No files matched your search

+25 -2
View File
@@ -2112,11 +2112,15 @@
async function submitApply(request) {
if (state.applyInFlight) return;
// Claim the attempt — including the controller used by the cancel path —
// before the first await. A second click cannot start a parallel replay
// with a different idempotency key, and Escape/close or a workspace or
// language change during the session wait aborts this attempt instead of
// letting it install itself and POST afterwards.
var controller = new AbortController();
var revision = state.revision;
var workspaceId = request.workspaceId;
var language = locale();
var controller = new AbortController();
state.applyController = controller;
state.applyInFlight = true;
state.applyOutcomeUnknown = false;
@@ -2126,6 +2130,25 @@
showRetry(false);
setStatus(tKey('openapi.status.applying'));
// A replay can start right after a reload, before the shell has restored the
// session and its CSRF token; sending the mutation without that token would
// be rejected as forbidden. Wait for the already-required authenticated
// session instead of firing an unauthenticated POST.
if (window.CrankAuth && typeof window.CrankAuth.getCsrfToken === 'function'
&& !window.CrankAuth.getCsrfToken()
&& typeof window.CrankAuth.fetchSession === 'function') {
try {
await window.CrankAuth.fetchSession(true);
} catch (_error) {
// A missing session stays a real 401/403 from the API, never a silent
// local success.
}
// A cancelled or superseded attempt owns no authority any more: it must
// neither re-install itself over the cancel/unknown state nor send its
// POST after the wait.
if (state.applyController !== controller) return;
}
try {
var response = await window.CrankApi.applyOpenApiImportPlan(
workspaceId,