Skip to content
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 "Revert "Enable noUncheckedIndexedAccess for loader packages (#21485)"" #23064

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Nov 12, 2024

Reverts #22380

@github-actions github-actions bot added area: loader Loader related issues base: main PRs targeted against main branch labels Nov 12, 2024
Copy link
Collaborator

@msfluid-bot msfluid-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Coverage Summary

↓ packages.loader.container-loader.src:
Line Coverage Change: -0.01%    Branch Coverage Change: No change
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 91.28% 91.28% → No change
Line Coverage 94.61% 94.60% ↓ -0.01%
↑ packages.loader.driver-utils.src:
Line Coverage Change: 0.01%    Branch Coverage Change: No change
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 90.06% 90.06% → No change
Line Coverage 81.93% 81.94% ↑ 0.01%
↑ packages.loader.driver-utils.src.adapters.compression.summaryblob:
Line Coverage Change: 0.02%    Branch Coverage Change: No change
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 84.37% 84.37% → No change
Line Coverage 96.15% 96.17% ↑ 0.02%
↑ packages.loader.driver-utils.src.protocol:
Line Coverage Change: 0.26%    Branch Coverage Change: No change
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 73.33% 73.33% → No change
Line Coverage 86.53% 86.79% ↑ 0.26%

Baseline commit: c7730cc
Baseline build: 306006
Happy Coding!!

Code coverage comparison check passed!!

@msfluid-bot
Copy link
Collaborator

@fluid-example/bundle-size-tests: +292 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 464.33 KB 464.36 KB +35 Bytes
azureClient.js 563.18 KB 563.23 KB +52 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 262.48 KB 262.5 KB +14 Bytes
fluidFramework.js 426.84 KB 426.85 KB +14 Bytes
loader.js 134.18 KB 134.21 KB +36 Bytes
map.js 42.71 KB 42.71 KB +7 Bytes
matrix.js 148.36 KB 148.36 KB +7 Bytes
odspClient.js 528.97 KB 529.04 KB +71 Bytes
odspDriver.js 97.88 KB 97.9 KB +21 Bytes
odspPrefetchSnapshot.js 42.81 KB 42.83 KB +14 Bytes
sharedString.js 164.26 KB 164.27 KB +7 Bytes
sharedTree.js 417.3 KB 417.3 KB +7 Bytes
Total Size 3.37 MB 3.37 MB +292 Bytes

Baseline commit: c7730cc

Generated by 🚫 dangerJS against 86ba09d

@RishhiB RishhiB marked this pull request as draft November 12, 2024 18:36
Copy link

@Copilot Copilot AI left a 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 13 changed files in this pull request and generated 1 suggestion.

Files not reviewed (8)
  • packages/loader/container-loader/tsconfig.json: Language not supported
  • packages/loader/driver-utils/tsconfig.json: Language not supported
  • packages/loader/driver-utils/src/prefetchDocumentStorageService.ts: Evaluated as low risk
  • packages/loader/driver-utils/src/insecureUrlResolver.ts: Evaluated as low risk
  • packages/loader/driver-utils/src/parallelRequests.ts: Evaluated as low risk
  • packages/loader/container-loader/src/connectionManager.ts: Evaluated as low risk
  • packages/loader/container-loader/src/containerStorageAdapter.ts: Evaluated as low risk
  • packages/loader/driver-utils/src/protocol/gitHelper.ts: Evaluated as low risk
Comments skipped due to low confidence (5)

packages/loader/container-loader/src/serializedStateManager.ts:416

  • Ensure that attributesHash and snapshotBlobs[attributesHash] are non-null before using non-null assertions. The TODO comment suggests further investigation is needed.
const attributes = JSON.parse(snapshotBlobs[attributesHash!]!);

packages/loader/container-loader/src/utils.ts:155

  • The non-null assertion on 'summary.tree[key]' should be reviewed to ensure it cannot be null or undefined.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

packages/loader/container-loader/src/utils.ts:431

  • The non-null assertion on 'attributesHash' should be reviewed to ensure it cannot be null or undefined.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

packages/loader/driver-utils/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts:66

  • Accessing the first element of the buffer without checking if the buffer is empty could lead to an error. Consider adding a check to ensure blob is not empty before accessing its first element.
const firstByte = IsoBuffer.from(blob)[0]!;

packages/loader/driver-utils/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts:96

  • Accessing the first element of the buffer without checking if the buffer is empty could lead to an error. Consider adding a check to ensure blob is not empty before accessing its first element.
const firstByte = IsoBuffer.from(blob)[0]!;

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

IsoBuffer.from(blob)[0] & 0x0f;
: // TODO why are we non null asserting here?
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion
IsoBuffer.from(blob)[0]! & 0x0f;
Copy link
Preview

Copilot AI Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing the first element of the buffer without checking if the buffer is empty could lead to an error. Consider adding a check to ensure blob is not empty before accessing its first element.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: loader Loader related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants