Refactor VPN proxy client implementation
Build and Deploy Gateway / build-and-push (push) Failing after 2s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-08-09 00:41:52 +03:00
parent 32be4380a3
commit 34d8b681ad
190 changed files with 20064 additions and 9761 deletions
+12 -2
View File
@@ -8,8 +8,8 @@ import {
atomicWriteJson,
createStateStore,
STATE_SCHEMA_VERSION,
} from '../../src/server/services/stateStore.js';
import { createServerId } from '../../src/shared/serverIdentity.js';
} from '../../dist/server/services/stateStore.js';
import { createServerId } from '../../dist/shared/serverIdentity.js';
const fixture = (t) => {
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'harbor-state-store-'));
@@ -17,6 +17,16 @@ const fixture = (t) => {
return path.join(directory, 'state.json');
};
test('raw JSON stores stay typed unknown until a migrator validates them', () => {
const source = fs.readFileSync(
new URL('../../src/server/services/stateStore.ts', import.meta.url),
'utf8',
);
assert.match(source, /createJsonStore\(options: RawJsonStoreOptions\): JsonStore<unknown>/);
assert.match(source, /const migrate = options\.migrate \|\| \(\(value: unknown\) => value\)/);
assert.doesNotMatch(source, /value as T|migrate = \(value\) => value as/);
});
test('data invariant: failure before rename preserves the last successful file', (t) => {
const filePath = fixture(t);
atomicWriteJson(filePath, { revision: 1 });