Files
Netcatty/application/state/sftp/transferCancelLatch.test.ts
T
bincxz d165e158f7 fix(sftp): unify transfer control under process-level TransferRuntime
Pause and resume now go through one process-level control plane that survives
panel/terminal close: TransferRuntime + soft latches/epochs/walk registry,
soft-then-hard resume, dual-epoch-safe progress, and no-owner soft control.
2026-07-26 21:27:01 +08:00

22 lines
779 B
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import {
clearTransferCancelledTree,
isTransferCancelledFlag,
isTransferOrRootCancelled,
markTransferCancelledTree,
resetTransferCancelLatchesForTests,
} from "./transferCancelLatch";
test("cancel flags are process-global for root and children", () => {
resetTransferCancelLatchesForTests();
markTransferCancelledTree("parent", ["c1", "c2"]);
assert.equal(isTransferCancelledFlag("parent"), true);
assert.equal(isTransferOrRootCancelled("parent", "c1"), true);
assert.equal(isTransferCancelledFlag("other"), false);
clearTransferCancelledTree("parent", ["c1", "c2"]);
assert.equal(isTransferCancelledFlag("parent"), false);
assert.equal(isTransferCancelledFlag("c1"), false);
});