diff --git a/packages/core/src/atomicFile.test.ts b/packages/core/src/atomicFile.test.ts index d5cfb891e0..83a55b2386 100644 --- a/packages/core/src/atomicFile.test.ts +++ b/packages/core/src/atomicFile.test.ts @@ -242,7 +242,7 @@ describe("createFileAtomically", () => { }; } - it.each(["EPERM", "ENOTSUP", "EOPNOTSUPP", "EXDEV", "EISDIR"])( + it.each(["EPERM", "ENOTSUP", "EOPNOTSUPP", "EXDEV", "EISDIR", "EACCES"])( "writes directly on a volume without hard links (%s)", (code) => { const dir = tempDir(); diff --git a/packages/core/src/atomicFile.ts b/packages/core/src/atomicFile.ts index a79103e544..3416d000f8 100644 --- a/packages/core/src/atomicFile.ts +++ b/packages/core/src/atomicFile.ts @@ -7,9 +7,9 @@ import { renameWithRetry } from "./renameWithRetry.js"; type SiblingFileSystem = Pick; type DirectFileSystem = SiblingFileSystem & Pick; -// Codes a volume without hard links (FAT, exFAT, some network shares) answers link() with. +// Codes a volume without hard links (FAT, exFAT, some network shares, Android app data) answers link() with. // EISDIR: libuv maps Windows ERROR_INVALID_FUNCTION (FAT/exFAT refusing a link) to it; nodejs/node#65817. -const NO_HARD_LINKS = new Set(["EPERM", "ENOTSUP", "EOPNOTSUPP", "EXDEV", "EISDIR"]); +const NO_HARD_LINKS = new Set(["EPERM", "ENOTSUP", "EOPNOTSUPP", "EXDEV", "EISDIR", "EACCES"]); const MAX_LINK_HOPS = 40; const TEMP_NAME_TRIES = 3; const TEMP_SUFFIX = /\.hf[0-9a-f]{6}\.tmp$/; diff --git a/packages/studio-server/src/history/ownerLock.test.ts b/packages/studio-server/src/history/ownerLock.test.ts index 6dcc7caff6..1183cd6eed 100644 --- a/packages/studio-server/src/history/ownerLock.test.ts +++ b/packages/studio-server/src/history/ownerLock.test.ts @@ -95,7 +95,7 @@ function withoutHardLinks(code = "ENOTSUP"): void { } describe("takeHistoryOwnership on a drive without hard links", () => { - it.each(["ENOTSUP", "EOPNOTSUPP", "ENOSYS", "EPERM"])( + it.each(["ENOTSUP", "EOPNOTSUPP", "ENOSYS", "EPERM", "EACCES"])( "takes the lock when linking fails with %s", async (code) => { withoutHardLinks(code); diff --git a/packages/studio-server/src/history/ownerLock.ts b/packages/studio-server/src/history/ownerLock.ts index 235c6e8546..e58336eac0 100644 --- a/packages/studio-server/src/history/ownerLock.ts +++ b/packages/studio-server/src/history/ownerLock.ts @@ -16,7 +16,7 @@ export class HistoryBusyError extends Error { } const WINDOWS_BUSY = new Set(["EPERM", "EBUSY", "EACCES"]); -const NO_HARD_LINKS = new Set(["ENOTSUP", "EOPNOTSUPP", "ENOSYS", "EPERM"]); +const NO_HARD_LINKS = new Set(["ENOTSUP", "EOPNOTSUPP", "ENOSYS", "EPERM", "EACCES"]); const TAKING_MS = 2_000; const BOOT_SLACK_MS = 60_000;