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

improvement(driver-utils): enable noUncheckedIndexedAccess #23759

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Feb 3, 2025

  • enable noUncheckedIndexAccess
// Total: 12 errors in 4 files

// File: src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts
// 3 errors:
Line 66: error TS18048: 'firstByte' is possibly 'undefined'.
  return (firstByte & 0xf0) === 0xb0;
         ~~~~~~~~~

Line 77: error TS2532: Object is possibly 'undefined'.
  IsoBuffer.from(blob)[0] & 0x0f;
  ~~~~~~~~~~~~~~~~~~~~~~~

Line 93: error TS18048: 'firstByte' is possibly 'undefined'.
  if ((firstByte & 0xf0) !== 0xb0) {
      ~~~~~~~~~

// File: src/insecureUrlResolver.ts
// 3 errors:
Line 57: error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string | null'.
  return this.resolveHelper(documentId, relativePath, parsedUrl.search);
                           ~~~~~~~~~~

Line 61: error TS18048: 'documentId' is possibly 'undefined'.
  const documentRelativePath = fullPath.slice(documentId.length);
                                             ~~~~~~~~~~

Line 62: error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string | null'.
  return this.resolveHelper(documentId, documentRelativePath);
                           ~~~~~~~~~~

// File: src/parallelRequests.ts
// 4 errors:
Line 598: error TS2532: Object is possibly 'undefined'.
  assert(deltas[0].sequenceNumber === fromTotal, 0x26d /* "wrong start" */);
         ~~~~~~~~~

Line 600: error TS2532: Object is possibly 'undefined'.
  assert(deltas[0].sequenceNumber === lastFetch + 1, 0x26e /* "wrong start" */);
         ~~~~~~~~~

Line 602: error TS2532: Object is possibly 'undefined'.
  lastFetch = deltas[deltas.length - 1].sequenceNumber;
             ~~~~~~~~~~~~~~~~~~~~~~~~~

Line 604: error TS2532: Object is possibly 'undefined'.
  lastFetch - deltas[0].sequenceNumber + 1 === deltas.length,
              ~~~~~~~~~

// File: src/protocol/gitHelper.ts
// 2 errors:
Line 87: error TS18048: 'node' is possibly 'undefined'.
  node.trees[decodeURIComponent(entryPathBase)] = newTree;
  ~~~~

Line 90: error TS18048: 'node' is possibly 'undefined'.
  node.blobs[decodeURIComponent(entryPathBase)] = entry.sha;
  ~~~~

@RishhiB RishhiB requested a review from jason-ha February 3, 2025 18:53
@RishhiB RishhiB self-assigned this Feb 3, 2025
@github-actions github-actions bot added base: main PRs targeted against main branch area: loader Loader related issues labels Feb 3, 2025
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

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

build is failing - adding comment to clear review requested

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.

3 participants