Add reproduction for internal/otlpEnv issue - #6863
Conversation
🦋 Changeset detectedLatest commit: 509b01f The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reproduction test for percent-decoding bug — adds
OtlpEnvHeaders.test.tsthat importsOtlpEnv.headers("TRACES")and asserts percent-encoded W3C Baggage values are decoded correctly.
The test reproduces the issue cleanly: "Bearer%20token" is returned as-is instead of "Bearer token". The root cause is in SchemaGetter.splitKeyValue (packages/effect/src/SchemaGetter.ts:1116), which splits on , and = but does not call decodeURIComponent on the resulting keys or values.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Fixed
HeadersRecordvalue schema — changed fromSchema.StringtoSchema.StringFromUriComponentinotlpEnv.ts:14, applyingdecodeURIComponentto percent-encoded OTLP header values. The same type is shared across all three signal fallbacks (LOGS, METRICS, TRACES) and the genericOTEL_EXPORTER_OTLP_HEADERSfallback, so the fix is comprehensive. - Added changeset —
.changeset/curly-ravens-decode.mdmarks the fix as a patch-level release. - Cleaned up test import — switched from relative path to package import
"effect/unstable/observability/internal/otlpEnv".
The fix is minimal, correct, and targeted — Schema.StringFromUriComponent decodes %20 → space, %2C → comma, matching W3C Baggage percent-encoding semantics exactly where the OTLP header parser consumes them.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Reproduction only
This PR adds reproduction tests only. No implementation fix is included. CI is expected to fail until the underlying issue is fixed.
Covered audit issues
1.
unstable-distributed-otlp-environment-header-percent-decoding: OTLP header values are not percent-decodedModule:
internal/otlpEnvExpected contract: OTLP W3C Baggage-formatted header values must decode percent-encoded octets.
Observed result: FAIL
Reproduction command: