fix(settings): send agent fetcher ids as numbers, not strings #46

Merged
David merged 1 commit from fix/vapp-33-agent-ids-u32 into main 2026-06-21 18:26:19 +02:00
Owner

The server's AgentBinaryFetcherConfig.agentids is Vec<u32>, but the apps client forwarded the free-text agent_ids: Vec<String> verbatim, so the wire value was ["6"] and vervain-server rejected the whole config with invalid type: string "6", expected u32, surfacing as a 500 and never persisting.

update_agent_fetcher_config now parses each id with str::parse::<u32>() before building the value block and sends a JSON array of numbers. A non-numeric entry returns an inline ServerFnError ("agent ids must be whole numbers, e.g. 6, 3") instead of forwarding a value the server rejects. The read path (parse_fetcher_config) already accepts both strings and numbers, so round-tripping existing ids is unchanged.

#VAPP-33

The server's `AgentBinaryFetcherConfig.agentids` is `Vec<u32>`, but the apps client forwarded the free-text `agent_ids: Vec<String>` verbatim, so the wire value was `["6"]` and vervain-server rejected the whole config with `invalid type: string "6", expected u32`, surfacing as a 500 and never persisting. `update_agent_fetcher_config` now parses each id with `str::parse::<u32>()` before building the `value` block and sends a JSON array of numbers. A non-numeric entry returns an inline `ServerFnError` ("agent ids must be whole numbers, e.g. 6, 3") instead of forwarding a value the server rejects. The read path (`parse_fetcher_config`) already accepts both strings and numbers, so round-tripping existing ids is unchanged. #VAPP-33
fix(settings): send agent fetcher ids as numbers, not strings
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m33s
Create release / Create release from merged PR (pull_request) Has been skipped
77ebf78be3
The server's `AgentBinaryFetcherConfig.agentids` is `Vec<u32>`, but the apps client forwarded the free-text `agent_ids: Vec<String>` verbatim, so the wire value was `["6"]` and vervain-server rejected the whole config with `invalid type: string "6", expected u32`, surfacing as a 500 and never persisting.

`update_agent_fetcher_config` now parses each id with `str::parse::<u32>()` before building the `value` block and sends a JSON array of numbers. A non-numeric entry returns an inline `ServerFnError` ("agent ids must be whole numbers, e.g. 6, 3") instead of forwarding a value the server rejects. The read path (`parse_fetcher_config`) already accepts both strings and numbers, so round-tripping existing ids is unchanged.

#VAPP-33
David merged commit e734f72dec into main 2026-06-21 18:26:19 +02:00
David deleted branch fix/vapp-33-agent-ids-u32 2026-06-21 18:26:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!46
No description provided.