Skip to content

fix(config): Fix inconsistent defaults for configs#6072

Merged
Dav1dde merged 2 commits into
masterfrom
dav1d/fix-config-defaults
Jun 11, 2026
Merged

fix(config): Fix inconsistent defaults for configs#6072
Dav1dde merged 2 commits into
masterfrom
dav1d/fix-config-defaults

Conversation

@Dav1dde

@Dav1dde Dav1dde commented Jun 10, 2026

Copy link
Copy Markdown
Member

Depending on how you instantiate the config you either get the derived Default or the serde default. Always use serde(default) on the struct, always implement Default.

@Dav1dde Dav1dde requested a review from a team as a code owner June 10, 2026 15:49
@Dav1dde Dav1dde self-assigned this Jun 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c569636. Configure here.

fn default_max_rate_limit() -> Option<u32> {
Some(300) // 5 minutes
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial config uses wrong defaults

High Severity

Container #[serde(default)] fills omitted keys with each field type’s Default, not values from the struct’s impl Default. Removing field-level serde(default = …) on Processing, EnvelopeSpool, and AuthConfig makes partial YAML (e.g. only enabled or path) deserialize with zeros, empty strings, or None instead of documented defaults like max_secs_in_future 60, signature_max_age 300, or spool limits.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c569636. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loewenheim loewenheim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to being correct it's also much nicer to read.

@Dav1dde Dav1dde added this pull request to the merge queue Jun 11, 2026
Merged via the queue into master with commit df7d50a Jun 11, 2026
39 of 51 checks passed
@Dav1dde Dav1dde deleted the dav1d/fix-config-defaults branch June 11, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants