fix(settings): send agent fetcher ids as numbers, not strings #46
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/vapp-33-agent-ids-u32"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The server's
AgentBinaryFetcherConfig.agentidsisVec<u32>, but the apps client forwarded the free-textagent_ids: Vec<String>verbatim, so the wire value was["6"]and vervain-server rejected the whole config withinvalid type: string "6", expected u32, surfacing as a 500 and never persisting.update_agent_fetcher_confignow parses each id withstr::parse::<u32>()before building thevalueblock and sends a JSON array of numbers. A non-numeric entry returns an inlineServerFnError("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