Repository navigation
Description
Context
Follow-up to #2160. Global configuration loading retains the URL value parsed by Zod, but the HTTP/WebSocket UI gate validates and then dispatches the original payload.
Discarding parsed UI values predates #2160. This issue tracks the remaining cross-entry-point inconsistency, not a new UI regression attributed to that PR.
Current behavior
At main commit 862aa9d6202fb875ed6c54fcddf0f201be112f50, getRequestPayloadValidationError() returns validation success or an error, without forwarding the parsed URL.
Zod URL parsing trims Unicode whitespace such as NBSP (U+00A0) and EM SPACE (U+2003). JavaScript’s new URL() does not apply the same trimming.
Observed behavior:
- A leading NBSP passes the UI schema gate, then the real station setter throws a contextual
BaseError. - A trailing NBSP passes the gate and produces an endpoint containing
/OCPP16%C2%A0/<stationId>. - The corresponding parsed configuration URL contains
/OCPP16/<stationId>, without the encoded whitespace. - Real WebSocket server probes confirm the changed request path. EM SPACE exhibits the same discrepancy.
Expected behavior
An accepted supervision URL has the same normalized meaning when consumed through global configuration and UI dispatch.
Validation must not approve a transformed value and then consume a different raw value.
Reproduction
- Prepare a valid
ws://supervision URL. - Prefix it with
U+00A0and submit it throughsetSupervisionUrl.url. - Observe schema acceptance followed by failure in station URL parsing.
- Submit the URL with trailing
U+00A0. - Observe the encoded whitespace in the station’s derived connection URL.
- Supply the same value through parsed global configuration and compare the normalized endpoint.
Scope
Ensure normalized supervision URL fields reach their consumers after successful validation.
Cover setSupervisionUrl.url and addChargingStations.options.supervisionUrls, including arrays.
Preserve unrelated PDU fields and optional-field presence. Do not replace every payload indiscriminately with a parsed object.
Do not silently normalize raw OCPP ChangeConfiguration values; that path has separate persistence semantics.
Acceptance criteria
- Cover leading and trailing NBSP and EM SPACE.
- Validated and consumed URL values agree across global configuration and UI entry points.
- Preserve existing ASCII whitespace normalization.
- Preserve unrelated payload fields and the distinction between omitted and explicitly provided optional values.
- Exercise both URL updates and station creation options.
- Verify the endpoint received by a real local WebSocket server.
Evidence and limits
The real UI validation function and real station setter were exercised on Node 24.22.1. Additional TCP probes used Node 26.12.1, ws 8.22.0 and zod 4.6.7.
No complete authenticated UI network session was exercised.
Related: #2160, #2168. No duplicate open issue was identified during this review.
Activity
jerome-benoit commentedon Nov 4, 2026
Fixed in #2181 (merged as 9ef343e on 2026-11-03): UI dispatch now overlays the schema-parsed, normalized supervision URL values onto the original payload, and the station routes every supervision URL through the shared SupervisionUrlSchema (Unicode whitespace trimming, scheme enforcement). Accepted and consumed values agree across global configuration and UI entry points.