Skip to content

fix(api): apply base_config defaults for boolean/int fields (#2121) - #2194

Open
Battleplus wants to merge 1 commit into
unclecode:mainfrom
Battleplus:fix/2121-boolean-config-values
Open

fix(api): apply base_config defaults for boolean/int fields (#2121)#2194
Battleplus wants to merge 1 commit into
unclecode:mainfrom
Battleplus:fix/2121-boolean-config-values

Conversation

@Battleplus

Copy link
Copy Markdown

Summary

Fixes #2121 — server-side base_config values (from config.yml) are silently ignored for boolean, integer, and other fields with non-None/non-empty defaults.

Root cause

api.py merged base_config defaults by checking current_value is None or current_value == "". Since CrawlerRunConfig fields like simulate_user default to False (not None, not ""), the server default was never applied.

Fix

Preserve the raw client config dict before deserialization and check key not in raw_dict instead of comparing against the current value. This correctly detects whether the client explicitly sent a field, regardless of its default type.

Files changed

  • deploy/docker/api.py (+12/-8)

…e#2121)

The base_config merging logic checked `current_value is None or current_value == ""`
to detect fields the client didn't send. This missed boolean defaults (False),
integer defaults (0), and other non-None/non-empty defaults — so server-side
config.yml values like `simulate_user: true` were silently ignored.

Fix: preserve the raw client config dict before deserialization and check
`key not in raw_dict` instead of comparing against the current value.

Closes unclecode#2121
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.

[Bug]: crawler.base_config boolean values are silently ignored (regression from #1505)

1 participant