Skip to content

fix(config): ignore unknown fields when parsing config.json#8

Open
YeonV wants to merge 1 commit into
nullclaw:mainfrom
YeonV:fix/config-ignore-unknown-fields
Open

fix(config): ignore unknown fields when parsing config.json#8
YeonV wants to merge 1 commit into
nullclaw:mainfrom
YeonV:fix/config-ignore-unknown-fields

Conversation

@YeonV
Copy link
Copy Markdown

@YeonV YeonV commented May 7, 2026

Problem

Config parsing uses std.json.parseFromSlice with default (strict) options, which returns error.UnknownField for any key not present in the Config struct. This causes a hard crash on startup whenever config.json contains a field that an older binary does not yet recognise.

A concrete case: nullhub's integration API writes a tracker key into config.json as part of wiring nullboiler to nulltickets. If the running nullboiler binary pre-dates the tracker field, the binary crashes immediately on startup and cannot be restarted without manually editing the config file.

Fix

Pass ignore_unknown_fields = true, consistent with ConcurrencyConfig parsing already present in this file (line 316):

const parsed = try std.json.parseFromSlice(Config, allocator, contents, .{ .ignore_unknown_fields = true });

Impact

Makes config parsing forward-compatible: binaries can safely load config files written by newer versions of the tooling without crashing.

Config parsing currently fails with error.UnknownField if config.json
contains any key not in the Config struct. This causes a hard crash on
startup whenever a newer tool (e.g. nullhub's integration API) has
written additional fields — such as the 'tracker' key — that an older
binary does not yet recognise.

Fix: pass ignore_unknown_fields = true, consistent with the existing
behaviour in ConcurrencyConfig parsing (line 316). This allows
forward-compatible config files and prevents crashes on
upgrade/downgrade paths between component versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant