diff --git a/apps/api/src/cutover-orchestrator.ts b/apps/api/src/cutover-orchestrator.ts index 8f466d4..19901e5 100644 --- a/apps/api/src/cutover-orchestrator.ts +++ b/apps/api/src/cutover-orchestrator.ts @@ -289,11 +289,14 @@ async function durableState(plan: CutoverPlan, state: CutoverState): Promise { } async function syncFile(path: string): Promise { - const handle = await open(path, 'r'); + // Windows FlushFileBuffers requires a writable handle; POSIX allows fsync on 'r'. + const handle = await open(path, process.platform === 'win32' ? 'r+' : 'r'); try { await handle.sync(); } finally { @@ -168,6 +169,7 @@ async function syncFile(path: string): Promise { } async function syncDirectory(path: string): Promise { + if (process.platform === 'win32') return; // directory fsync only exists on POSIX const handle = await open(path, 'r'); try { await handle.sync(); diff --git a/apps/api/src/release-evidence.ts b/apps/api/src/release-evidence.ts index aafecbe..71f8bdc 100644 --- a/apps/api/src/release-evidence.ts +++ b/apps/api/src/release-evidence.ts @@ -254,11 +254,14 @@ export async function appendReleaseEvidence( await handle.close(); } await rename(temporary, absolute); - const directory = await open(parent, 'r'); - try { - await directory.sync(); - } finally { - await directory.close(); + if (process.platform !== 'win32') { + // directory fsync only exists on POSIX + const directory = await open(parent, 'r'); + try { + await directory.sync(); + } finally { + await directory.close(); + } } return Object.freeze(record); } finally { diff --git a/eslint.config.js b/eslint.config.js index d03bf4d..8d5259d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -30,6 +30,14 @@ export default defineConfig( }, rules: { 'no-undef': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], }, }, ); diff --git a/test/phase-one-blockers.test.js b/test/phase-one-blockers.test.js index ec21915..7bf5424 100644 --- a/test/phase-one-blockers.test.js +++ b/test/phase-one-blockers.test.js @@ -14,7 +14,7 @@ import { RequestCoordinator } from '../public/state/request-coordinator.js' import { createApiClient } from '../public/infrastructure/api-client.js' import { createViewRouter } from '../public/router/view-router.js' -const projectRoot = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..') +const projectRoot = path.resolve(import.meta.dirname, '..') async function files(instances = []) { const dir = await mkdtemp(path.join(tmpdir(), 'msa-blockers-'))