mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-20 15:19:16 +00:00
Make folder pause latch-first with barriers and a child pause watchdog so workers stop claiming files after soft-drain; soft-resume live walks instead of full rewalks. Surface path conflicts with toasts, keep pause progress visible, and show a resume spinner. Restore verified shell rm -rf with SFTP confirmation for fast directory delete, and prefer reconnect over wiping the pane to the host picker when listing fails on some hosts.
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { canReconnectSftpPane } from "./useSftpSessionErrors.ts";
|
|
|
|
test("can reconnect when lastHost is a vault host", () => {
|
|
assert.equal(
|
|
canReconnectSftpPane({
|
|
lastHost: { id: "h1", label: "box", hostname: "1.2.3.4" } as never,
|
|
connection: null,
|
|
}),
|
|
true,
|
|
);
|
|
});
|
|
|
|
test("can reconnect from connection.hostId even when lastHost is missing", () => {
|
|
assert.equal(
|
|
canReconnectSftpPane({
|
|
lastHost: null,
|
|
connection: {
|
|
id: "c1",
|
|
isLocal: false,
|
|
hostId: "h1",
|
|
hostLabel: "box",
|
|
currentPath: "/",
|
|
status: "connected",
|
|
} as never,
|
|
}),
|
|
true,
|
|
);
|
|
});
|
|
|
|
test("can reconnect for local even without lastHost", () => {
|
|
assert.equal(
|
|
canReconnectSftpPane({
|
|
lastHost: null,
|
|
connection: {
|
|
id: "local",
|
|
isLocal: true,
|
|
currentPath: "/",
|
|
status: "connected",
|
|
} as never,
|
|
}),
|
|
true,
|
|
);
|
|
});
|
|
|
|
test("cannot reconnect without any host identity", () => {
|
|
assert.equal(
|
|
canReconnectSftpPane({
|
|
lastHost: null,
|
|
connection: null,
|
|
}),
|
|
false,
|
|
);
|
|
});
|