feat(local): plan secret config reconciliation

This commit is contained in:
whyour
2026-08-23 16:13:47 +08:00
parent dbd219bedc
commit fbb67ff5c8
10 changed files with 1035 additions and 92 deletions
@@ -212,3 +212,34 @@ test('rejects unsupported schemas and over-budget Edge tables without scanning r
overBudget.close();
}
});
test('preserves a visitor failure instead of disguising it as a SQLite read error', () => {
const database = memoryDatabase(`
CREATE TABLE "Envs" (
id INTEGER PRIMARY KEY,
name TEXT,
value TEXT,
status INTEGER,
position REAL,
"isPinned" INTEGER,
"createdAt" TEXT
);
INSERT INTO "Envs" VALUES
(1, 'TOKEN', 'private-value', 0, 1, 0, '2026-01-01');
`);
const expected = new Error('caller byte budget exceeded');
try {
assert.throws(
() =>
visitLegacyEnvironmentAdoption(database, {
profile: 'edge',
visitRow() {
throw expected;
},
}),
(error) => error === expected,
);
} finally {
database.close();
}
});