Skip to content

STG 103 File List Ranges Continuation Token#39232

Open
aanubhav-msft wants to merge 9 commits into
feature/storage/STG_103_104from
feature/storage/STG103_PaginateFileGetRanges
Open

STG 103 File List Ranges Continuation Token#39232
aanubhav-msft wants to merge 9 commits into
feature/storage/STG_103_104from
feature/storage/STG103_PaginateFileGetRanges

Conversation

@aanubhav-msft

Copy link
Copy Markdown
Member

Packages impacted by this PR

  • @azure/storage-file-share

Issues associated with this PR

Describe the problem that is addressed by this PR

The existing ShareFileClient.getRangeList() and ShareFileClient.getRangeListDiff() methods return the complete list of file ranges in a single, non-paginated response. For files with a very large number of ranges, this can be inefficient and does not allow callers to consume results page-by-page or resume via a continuation token.

This PR adds paginated variants that list file ranges as a PagedAsyncIterableIterator with continuation-token support, backed by the new 2026-10-06 service API version (listAllRanges REST operation, comp=rangelist with marker/maxresults).

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Yes.

  • test/fileclient.spec.ts: end-to-end tests for listRanges, listRanges with a share snapshot, listRanges by page, listRanges with a continuation token, listRangesDiff, listing ranges on an empty file, and interleaving of cleared/populated diff ranges.
  • test/utils.spec.ts: unit tests for extractShareFileRangeItems covering equal-start ordering, interleaving, leftover ranges from either side, and empty inputs.
  • Test recording assets updated (assets.json tag bump).

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

@aanubhav-msft aanubhav-msft requested a review from Copilot July 10, 2026 09:23
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Jul 10, 2026
@aanubhav-msft aanubhav-msft changed the title Feature/storage/stg103 paginate file get ranges STG 103 File List Ranges Continuation Token Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds paginated file-range listing with continuation-token support to @azure/storage-file-share.

Changes:

  • Adds listRanges() and listRangesDiff() paged APIs.
  • Updates generated code to Storage API 2026-10-06.
  • Adds range-merging logic, tests, recordings, and API documentation.

Reviewed changes

Copilot reviewed 11 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsp-location.yaml Updates the TypeSpec source commit.
test/utils.spec.ts Tests range merging.
test/fileclient.spec.ts Tests new range-listing APIs.
src/utils/utils.common.ts Merges populated and cleared ranges.
src/generatedModels.ts Adds the public range item model.
src/generated/static-helpers/serialization/get-binary-stream-response.ts Adds Node stream handling.
src/generated/static-helpers/serialization/get-binary-stream-response-react-native.mts Adds React Native mapping.
src/generated/static-helpers/serialization/get-binary-stream-response-browser.mts Adds browser stream handling.
src/generated/static-helpers/platform-types.ts Defines the Node stream type.
src/generated/static-helpers/platform-types-react-native.mts Defines the React Native variant.
src/generated/static-helpers/platform-types-browser.mts Defines the browser variant.
src/generated/models/models.ts Adds paginated response models and API version.
src/generated/models/index.ts Exports the paginated model.
src/generated/index.ts Exports generated range APIs.
src/generated/classic/file/index.ts Exposes listAllRanges.
src/generated/api/share/operations.ts Updates share operations’ API version.
src/generated/api/service/operations.ts Updates service operations’ API version.
src/generated/api/file/options.ts Adds pagination protocol options.
src/generated/api/file/operations.ts Implements the protocol operation.
src/generated/api/file/index.ts Exports the protocol operation.
src/generated/api/directory/operations.ts Updates directory operations’ API version.
src/Clients.ts Implements the public paginated iterators.
review/storage-file-share-node.api.md Records the Node API surface.
review/storage-file-share-browser.api.diff.md Updates browser API differences.
metadata.json Records API version and definitions.
CHANGELOG.md Announces the new APIs and deprecations.
assets.json Updates test-recording assets.

Comment thread sdk/storage/storage-file-share/src/Clients.ts
Comment thread sdk/storage/storage-file-share/src/Clients.ts
Comment thread sdk/storage/storage-file-share/CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants