amplitude / amplitude/experiment-node-server
TypeError: _a.trim is not a function during exposure event
- Linguagem predominante
- TypeScript
- Estrelas
- 2
- Forks
- 8
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
## Expected Behavior
The Experiment Node Server SDK should safely handle non-string values when canonicalizing exposure data before calling `.trim()`. Invalid or unexpected input types should not cause a runtime exception during variant evaluation or exposure tracking.
## Current Behavior
A runtime exception is thrown during exposure tracking:
````
TypeError _a.trim is not a function
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure.js:16:93 Exposure.canonicalize
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-filter.js:16:44 InMemoryExposureFilter.shouldTrack
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js:23:37 AmplitudeExposureService.
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js:8:71
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js:4:12 __awaiter
/app/node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js:22:16 AmplitudeExposureService.track
/app/node_modules/@amplitude/experiment-node-server/dist/src/local/client.js:149:87 LocalEvaluationClient.evaluateV2
.next/server/chunks/7651.js:19:1755 d.fetchVariants
````
## Possible Solution
Improve input validation earlier in the exposure pipeline.
## Steps to Reproduce
We weren't able to reproduce it locally.
## Environment
- JS Server SDK Version: 1.13.2
- Runtime: Node.js
- Installation Method: yarn
- Browser and Version: N/A
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.