Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (421 lines, 28 files), I've queued these reviewers:
How this works
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔭 PR Review Fleet ReportNote This report is generated by an experimental AI review fleet and is provided as a beta feature. Findings are a starting point for discussion, not a gate. Use your own judgement. Verdict: 0 Disastrous, 1 Dangerous, 2 Disagreeable Findings
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Address the compact snapshot error classification and string telemetry issues before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Enables noUncheckedIndexedAccess for the ODSP driver’s production and test builds, adding explicit handling for potentially missing indexed values.
Changes:
- Adds bounds and presence checks across snapshot, delta, URL, summary, and buffer processing.
- Updates compact snapshot parsing and serialization.
- Adjusts tests and removes obsolete lint suppression.
File summaries
| File | Reviewed changes |
|---|---|
packages/drivers/odsp-driver/tsconfig.json |
Enables strict unchecked indexed-access checking. |
packages/drivers/odsp-driver/src/zipItDataRepresentationUtils.ts |
Adds node and buffer validation. Nit (1 vote): missing string inputs report BlobCore instead of String. |
packages/drivers/odsp-driver/src/WriteBufferUtils.ts |
Narrows boolean code mapping. |
packages/drivers/odsp-driver/src/test/zipItDataRepresentationTests.spec.ts |
Tests missing node handling. |
packages/drivers/odsp-driver/src/test/tsconfig.json |
Inherits strict indexed-access checking. |
packages/drivers/odsp-driver/src/test/socketTests/socketMock.ts |
Guards protocol version access. |
packages/drivers/odsp-driver/src/test/socketTests/deltaConnectionUpdateTests.spec.ts |
Guards metadata fields. |
packages/drivers/odsp-driver/src/test/prefetchSnapshotTests.spec.ts |
Guards snapshot tree access. |
packages/drivers/odsp-driver/src/test/opsCaching.spec.ts |
Guards cached operation access. |
packages/drivers/odsp-driver/src/test/odspPointInTimeDocumentService.spec.ts |
Guards stream batches and calls. |
packages/drivers/odsp-driver/src/test/getUrlAndHeadersWithAuth.spec.ts |
Guards authorization header access. |
packages/drivers/odsp-driver/src/test/fetchSnapshot.spec.ts |
Guards required stub calls. |
packages/drivers/odsp-driver/src/test/deltaStorageService.spec.ts |
Guards message access. |
packages/drivers/odsp-driver/src/test/createNewUtilsTests.spec.ts |
Guards blob IDs. |
packages/drivers/odsp-driver/src/ReadBufferUtils.ts |
Adds buffer bounds validation. |
packages/drivers/odsp-driver/src/odspUrlHelper.ts |
Validates URL capture groups. |
packages/drivers/odsp-driver/src/odspSummaryUploadManager.ts |
Guards summary entries. |
packages/drivers/odsp-driver/src/odspSnapshotParser.ts |
Validates snapshot roots and operations. |
packages/drivers/odsp-driver/src/odspDriverUrlResolver.ts |
Validates URL decomposition. |
packages/drivers/odsp-driver/src/odspDocumentStorageServiceBase.ts |
Guards versions and snapshot trees. |
packages/drivers/odsp-driver/src/odspDocumentDeltaConnection.ts |
Guards message boundaries. |
packages/drivers/odsp-driver/src/odspDeltaStorageService.ts |
Guards delta response entries. |
packages/drivers/odsp-driver/src/localOdspDriver/localOdspDeltaStorageService.ts |
Guards cached messages. |
packages/drivers/odsp-driver/src/fetchSnapshot.ts |
Guards snapshot operations. |
packages/drivers/odsp-driver/src/createFile/createNewUtils.ts |
Guards summary entries. |
packages/drivers/odsp-driver/src/compactSnapshotWriter.ts |
Guards operation indexing. |
packages/drivers/odsp-driver/src/compactSnapshotParser.ts |
Moderate (3 votes): missing records.snapshot uses a generic Error instead of the typed incorrectServerResponse path; also affects line 306. |
packages/drivers/odsp-driver/eslint.config.mts |
Removes the obsolete unchecked-access rule. |
Review details
Suppressed comments (2)
packages/drivers/odsp-driver/src/compactSnapshotParser.ts:308
- The missing
records.blobscase has the same error-classification problem: a malformed compact response becomes a plainErrorrather than the existingincorrectServerResponsevalidation error. Assert the narrowed value withassertNodeCoreInstancebefore passing it toreadBlobSection, matching the other compact snapshot fields.
if (blobsNode === undefined) {
throw new Error("Compact snapshot is missing the blobs record");
}
packages/drivers/odsp-driver/src/zipItDataRepresentationUtils.ts:620
- The new undefined-input branch reports
expectedNodeType: "BlobCore", although this helper validates a string andNodeTypehas a distinct"String"value. Missing string fields will therefore emit misleading parser telemetry; use"String"here and in the existing fallback below so both invalid-input paths describe the helper's actual contract.
export function getStringInstance(node: NodeTypes | undefined, message: string): string {
if (node === undefined) {
throwBufferParseException(node, "BlobCore", message);
}
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bundle size comparisonBase commit: Notable changes
Per-bundle deltas
|
How contribute to this repo.
Guidelines for Pull Requests.
Description
Enables TypeScript's
noUncheckedIndexedAccessoption for@fluidframework/odsp-driverproduction and test builds, resolving AB#34163.Production indexed accesses now use explicit undefined checks and throw when required values are missing. The PR introduces no production non-null assertion operators. Test-only non-null assertions remain where a failed presence assumption naturally fails the test.
Compact snapshot validator functions accept possibly undefined indexed values and reject them through the existing
incorrectServerResponsevalidation path. Functions that require valid nodes retain narrow contracts, with callers checking before invocation.Reviewer Guidance
The review process is outlined in the pull request guidelines.
Please focus on the explicit failure paths for missing array and record entries and on the compact snapshot validator behavior.