fix: reset schemaDeclarationRef on JSON parse failure
When UnknownJson decoding fails (malformed file), the schemaDeclarationRef was not reset to undefined. On a file-watcher reload, a stale $schema value from a previous successful load would survive and get injected into the next updateSettings call. Add the missing else branch to reset the ref, consistent with the file-not-found case.
This commit is contained in:
1 file changed
+2
@@ -228,6 +228,8 @@ const makeServerSettings = Effect.gen(function* () {
|
||||
? valueRecord[SETTINGS_SCHEMA_DECLARATION_KEY]
|
||||
: undefined;
|
||||
yield* Ref.set(schemaDeclarationRef, schemaDeclaration);
|
||||
} else {
|
||||
yield* Ref.set(schemaDeclarationRef, undefined);
|
||||
}
|
||||
|
||||
const decoded = Schema.decodeUnknownExit(ServerSettingsJson)(raw);
|
||||
|
||||
Reference in new issue
Block a user