-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert #23583: Ineffective TypeScript type handling in telemetry utils #23615
Revert #23583: Ineffective TypeScript type handling in telemetry utils #23615
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
packages/utils/telemetry-utils/src/test/config.spec.ts:25
- Removing the null coalescing operator might introduce a bug if
settings[key]
can be undefined. Consider keeping the null coalescing operator to handle undefined values.
return settings[key];
packages/utils/telemetry-utils/src/test/errorLogging.spec.ts:692
- [nitpick] The removal of the explicit type declaration for 'annotations' might introduce ambiguity. The type should be explicitly declared to maintain clarity.
const annotations = annotationCases[annotationCase];
packages/utils/telemetry-utils/src/mockLogger.ts:335
- The removal of the type annotation for
actualValue
might introduce a bug ifactual
can contain values that are not of the expected type. Consider keeping the type annotation to ensure type safety.
const actualValue = actual[expectedKey];
Please update the title and description - it is not that changes are "not needed". The changes don't have the desired result. They resolve the linter rule complaint, but don't change TypeScript treatment of types. TypeScript ignores the |
The changes in #23583 for handling record access in telemetry utils didn't achieve the intended type safety improvements. While they satisfied linter rules, TypeScript still ignores
undefined
possibilities, leaving type analysis in these situations potentially untested.