refactor(api): extend #206 type-safety to telemetry (#359 batch 3)#379
Merged
Conversation
…atch 3) Apply the #206 playbook to telemetry.ts. 9 `as never` casts removed. src/lib/api/telemetry.ts: + adaptCrashReport — normalize SDK's `?: string | null` (stack_trace, os_info, uptime_seconds, submitted_at, submission_error) to local type's `: string | null` + adaptCrashList / adaptTelemetrySettings — pass-through with explicit field forwarding so a future local-type addition surfaces at typecheck + assertData on every successful read Tests rewritten with realistic SDK fixtures (typed as Sdk* for compile- time drift detection) and assertions on adapter output. Added regression tests for undefined → null normalization, empty response body via assertData, and submitCrashes body shape. CHANGELOG entry under [Unreleased] / Changed. Closes #359 (partial — batch 3 of N). Remaining: dependency-track, promotion, replication (medium), sbom, security, sso (large).
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #359 (partial — batch 3). Same playbook as batches 1+2: adapters +
assertDataforsrc/lib/api/telemetry.ts. 9as neverremoved; zero retained casts.Acceptance criteria
as unknown as/as neverin changed filesTest plan
npm test— 2063/2063npm run lint— 0 errorsnpm run build— succeedsRemaining
dependency-track / promotion / replication (medium); sbom / security / sso (large) — to be split across subsequent PRs to keep review tractable.
🤖 Generated with Claude Code