amplitude / amplitude/experiment-node-server
TypeError: _a.trim is not a function during exposure event
- 主要語言
- TypeScript
- 星號
- 2
- 分支
- 8
- PR 合併指標
- 30 天內沒有已合併 PR
描述
## 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
貢獻指南
評估
這個 Issue 還沒有評估資料。