fix: bootstrap user preferences without invalidating DWH cache
This commit is contained in:
+7
-1
@@ -64,7 +64,13 @@ export function buildApp(config: AppConfig, deps?: BuildAppDeps): FastifyInstanc
|
||||
// The real runner persists preferences through the harness repository. The file fallback
|
||||
// only keeps older isolated route tests and externally injected runners compatible.
|
||||
if (typeof runner.preferencesGet === "function") {
|
||||
return effectiveSettings(config, await runner.preferencesGet());
|
||||
const stored = await runner.preferencesGet() as Settings;
|
||||
if (Object.keys(stored).length === 0) {
|
||||
const seeded = effectiveSettings(config, loadSettings(config));
|
||||
await runner.preferencesSet(seeded);
|
||||
return seeded;
|
||||
}
|
||||
return effectiveSettings(config, stored);
|
||||
}
|
||||
return effectiveSettings(config, loadSettings(config));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user