v0.5.2
Patch release fixing two defects in the shared HTTP core and documenting an ESM/CommonJS limitation. Each fix is covered by a regression test that fails without it.
Fixes
-
A public
applicationNameno longer corrupts provider responses. Providers that identify the caller through a public header — Entur'sET-Client-Name, NVDB'sX-Client, MET Norway'sUser-Agent— had that header's value treated as a secret and stripped out of successful payloads before validation. AnapplicationNamethat also occurred in a provider's own data rewrote it: an application calledvegvesenturned NVDB's continuation URL intohttps://nvdbapiles.atlas.[REDACTED].no/…, which then failed URL validation and made everyroads.getRoadNetwork()androads.getRoadNetworkAll()call raiseResponseValidationError. Caller identification is public by design, so it is no longer a redaction target. Genuine secrets are unaffected:contactEmail, configuredapiKeyvalues, andAuthorization,CookieandX-API-Keyheader values are still redacted from payloads and errors, and properties named after request headers are still dropped. -
Retry-Afteris no longer shortened to the backoff cap. A provider asking for a 30-second pause was retried after 5 seconds, because the five-second cap on the SDK's own exponential backoff was also applied to the provider's explicit instruction. The two are now distinct:- with no
Retry-After, capped jittered backoff as before; - with a
Retry-Afterof up to 60 seconds, the stated duration is waited in full; - beyond 60 seconds the retry stops without waiting first.
The status-to-error mapping is unchanged:
RateLimitErrorfor HTTP 429, the usualProviderErrorfor a retryable 5xx. Both carryretryAfterin seconds, which is the stable cross-status signal that a provider asked you to wait. Cancelling the caller'ssignalstill rejects a waiting retry immediately. Retryable statuses and attempt counts are unchanged.This changes timing for callers that hit HTTP 429 or a retryable 5xx carrying
Retry-After: those retries now happen later than before, or surface as an error instead of retrying. That is the intended correction. - with no
-
Mixed ESM/CommonJS error identity is now documented. When one process loads both published builds, an error from one fails
instanceofagainst the other build's class, because class identity is per-bundle. This is a property of dual-published packages and is documented rather than worked around — no symbol branding or prototype manipulation was introduced. The README recommends branching on the stablename,provider,statusCodeandretryAfterfields where an error can cross that boundary, and the packed-package test now asserts same-buildinstanceofin both builds and verifies that fallback.
No public type or signature changed.
npm install norway-open-data-sdk@0.5.2