-
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
Partially revert #23432 "Prefix ... no-unchecked-record-access..." #23486
Partially revert #23432 "Prefix ... no-unchecked-record-access..." #23486
Conversation
…cord-access for client packages (microsoft#23432)" This reverts commit 88caebd where `?` was used to address linter defect. Many of the test uses of `?` in original change are permissible as there is a follow-up assertion that will fail. But those were not separated during revert. Changes from original commit that used expected safe adjustments are retained.
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 5 out of 18 changed files in this pull request and generated no comments.
Files not reviewed (13)
- packages/dds/map/src/test/mocha/directory.spec.ts: Evaluated as low risk
- packages/runtime/id-compressor/src/test/idCompressor.spec.ts: Evaluated as low risk
- packages/runtime/runtime-utils/src/test/summaryUtils.spec.ts: Evaluated as low risk
- packages/test/test-drivers/src/odspTestDriver.ts: Evaluated as low risk
- packages/runtime/container-runtime/src/test/gc/gcStats.spec.ts: Evaluated as low risk
- packages/drivers/odsp-driver/src/test/prefetchSnapshotTests.spec.ts: Evaluated as low risk
- packages/drivers/routerlicious-driver/src/documentServiceFactory.ts: Evaluated as low risk
- packages/dds/map/src/directory.ts: Evaluated as low risk
- experimental/dds/attributable-map/src/mapKernel.ts: Evaluated as low risk
- packages/drivers/odsp-driver/src/odspDriverUrlResolver.ts: Evaluated as low risk
- packages/drivers/routerlicious-driver/src/documentService.ts: Evaluated as low risk
- packages/runtime/container-runtime/src/test/containerRuntime.spec.ts: Evaluated as low risk
- packages/dds/map/src/mapKernel.ts: Evaluated as low risk
Comments suppressed due to low confidence (3)
packages/loader/driver-utils/src/test/summaryCompresssionTester.spec.ts:72
- Direct property access without optional chaining may cause runtime errors if 'tree' is undefined. Ensure 'tree' is always defined or add appropriate checks.
).tree.header;
packages/loader/driver-utils/src/test/summaryCompresssionTester.spec.ts:94
- Direct property access without optional chaining may cause runtime errors if 'tree' is undefined. Ensure 'tree' is always defined or add appropriate checks.
).tree.header;
packages/loader/driver-utils/src/test/summaryCompresssionTester.spec.ts:624
- Direct property access without optional chaining may cause runtime errors if 'tree' is undefined. Ensure 'tree' is always defined or add appropriate checks.
return getHeaderHolder(summary).tree.header;
…rd-access for client packages (microsoft#23432)" This reverts commit 88caebd where `T | undefined` was used to address linter defect. TypeScript will narrow without `undefined` without noUncheckedIndexAccess enabled. So remove ineffective pattern. The only files that retained changes are: packages/dds/merge-tree/src/test/beastTest.spec.ts packages/drivers/odsp-driver/src/WriteBufferUtils.ts packages/runtime/id-compressor/src/test/idCompressor.spec.ts packages/tools/fetch-tool/src/fluidFetchSnapshot.ts
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.
Devtools 👍
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.
merge-tree looks good
Partially revert "Prefix trivial issues when enabling no-unchecked-record-access for client packages (#23432)"
This reverts commit 88caebd where:
?
was used to address linter defect. TypeScript appears to mostly ignore that these cases may lead toundefined
result which is not accepted per type specifications. Use of?
is thus a behavior change that will shift point of failure away from where it could first be detected - revert those behavior changes. (Many of the test uses of?
in original change are permissible as there is a follow-up assertion that will fail. But those were not separated during revert.)T | undefined
was used to address linter defect. TypeScript will narrow withoutundefined
withoutnoUncheckedIndexAccess
enabled.The only files that retained changes from original commit are:
packages/dds/merge-tree/src/test/beastTest.spec.ts
packages/drivers/odsp-driver/src/WriteBufferUtils.ts
packages/runtime/id-compressor/src/test/idCompressor.spec.ts
packages/tools/fetch-tool/src/fluidFetchSnapshot.ts