Skip to content

fix(config): write durations as strings in JSON - #512

Merged
jahvon merged 1 commit into
mainfrom
fix/config-duration-json
Nov 7, 2026
Merged

jahvon merged 1 commit into
mainfrom
fix/config-duration-json

Conversation

@jahvon

@jahvon jahvon commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

flow config get --output json wrote defaultTimeout and logRetention.maxAge as nanosecond integers (encoding/json's default for time.Duration), while the config file and the published schema spell them as duration strings such as 5m0s.

Config and LogRetention now marshal those fields as duration strings; unset durations are still omitted, and a maxAge of zero (no limit) stays 0s. YAML is unchanged.

`flow config get --output json` wrote defaultTimeout and
logRetention.maxAge as nanosecond integers, the encoding/json default for
time.Duration, while the config file and the published schema spell them
as duration strings ("5m0s"). Anything typed from the schema fails to read
a config once either is set; the Mochi desktop app stopped loading after
setting a timeout.
@jahvon
jahvon marked this pull request as ready for review November 7, 2026 02:14
@jahvon
jahvon merged commit 60ed9e6 into main Nov 7, 2026
16 checks passed
@jahvon
jahvon deleted the fix/config-duration-json branch November 7, 2026 02:15
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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