You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] --configure-network writes invalid JSON (comma after the colon) when a postgres/mcp/web section's last member is a string with no trailing comma #2073
On a minimal darling.json, --configure-network (the Store branch, or any branch that adds a network block to an existing section) produces invalid JSON and aborts with "the edited darling.json did not parse … No changes were written." - so LAN exposure can't be configured via the wizard for such a file.
Run PerformanceMonitor.Darling.Service.exe --configure-network, choose All (or just Store), enter a bind IP, CIDR, role.
At write time:
Internal error: the edited darling.json did not parse (',' is an invalid start of a value. Path: $.postgres.dataDirectory | LineNumber: 3 | BytePositionInLine: 20.). No changes were written.
Expected Behavior
To work.
Actual Behavior
Not working.
Error Messages / Log Output
Screenshots
No response
Additional Context
Root cause: DarlingNetworkConfigEditor.InsertAsLastMember (Darling/PerformanceMonitor.Darling.Service/DarlingNetworkConfigEditor.cs:626-650) locates the previous member's end via PreviousCodeIndex(objectClose, objectOpen). PreviousCodeIndex skips StringLiteral regions, so when the last member's value is a string with no trailing comma (and no following commented template), it walks past the entire value and lands on the colon between key and value. needComma is then true and the comma is spliced in after the colon → "dataDirectory":, "…". It only bites a string-valued last member without a trailing comma; the shipped sample's postgres block ends "connectAs": "admin",, so the fixtures never exercise this shape.
Suggested fix: derive the comma-insertion point from the last member's actual value end (string-aware — e.g. reuse ValueEndFrom / enumerate members) instead of PreviousCodeIndex, which is blind to string values. Add a regression fixture with a minimal postgres/mcp/web block whose last member is string-valued and comma-less.
Thank you for an exceptional report — the root cause was exactly as you diagnosed, verified against the classifier: string values are entirely StringLiteral region (quotes included), so PreviousCodeIndex's code-only walk from the closing brace skipped the whole value and landed on the colon, and the synthesized separator spliced in there. Only a string-valued, comma-less last member trips it, which is why the shipped sample's fixtures never caught the shape.
Fix is up in #2075: a member-end-aware scan (PreviousMemberEndIndex) that treats a string-literal hit as the value's closing quote — a real trailing comma is Code and is found first, and quoted runs inside comments classify as Comment, so the hit is always a genuine value end. Your minimal config is the regression fixture verbatim, asserted through the same parse gate the wizard enforces plus the live ResolveNetworkExposure path. The other PreviousCodeIndex call site (member removal) only ever looks for ,/{ and is unaffected.
Will land on dev shortly and ride the next nightly.
Fixed by #2075 (merged to dev) — the member-end-aware scan replaces the code-only walk, with your minimal config as the regression fixture. The fix is in the published 3.3.0-nightly.20260805 build if you want it before the next stable release.
Activity
erikdarlingdata commentedon Aug 5, 2026
Thank you for an exceptional report — the root cause was exactly as you diagnosed, verified against the classifier: string values are entirely
StringLiteralregion (quotes included), soPreviousCodeIndex's code-only walk from the closing brace skipped the whole value and landed on the colon, and the synthesized separator spliced in there. Only a string-valued, comma-less last member trips it, which is why the shipped sample's fixtures never caught the shape.Fix is up in #2075: a member-end-aware scan (
PreviousMemberEndIndex) that treats a string-literal hit as the value's closing quote — a real trailing comma is Code and is found first, and quoted runs inside comments classify as Comment, so the hit is always a genuine value end. Your minimal config is the regression fixture verbatim, asserted through the same parse gate the wizard enforces plus the liveResolveNetworkExposurepath. The otherPreviousCodeIndexcall site (member removal) only ever looks for,/{and is unaffected.Will land on dev shortly and ride the next nightly.
Merge pull request #2075 from erikdarlingdata/confignet-comma-2073
erikdarlingdata commentedon Aug 5, 2026
Fixed by #2075 (merged to dev) — the member-end-aware scan replaces the code-only walk, with your minimal config as the regression fixture. The fix is in the published
3.3.0-nightly.20260805build if you want it before the next stable release.Fix --configure-network comma splice after string-valued last members (…