feat(client): batch read methods for signed URLs, versions, metadata and folders - #42
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Client methods for the new storage batch endpoints. Pairs with platform_backend-api#352, which has the background: throttling is per endpoint per user, so a client that resolves one id per request runs into 429s well before it is doing anything abusive. Tile-based viewers and the models list panel both hit that today.
Changes
New methods on
EngineServicesClient:getHiddenFileSignedUrlsBatch(hiddenIds, expiresIn?)— the one splat and point-cloud viewers should use instead ofgetHiddenFileSignedUrlper tile.listVersionsBatch(itemIds, { archived? })— the returned records carry their metadata, so a list that only needs metadata does not need a second call.getFileVersionMetadataBatch(entries, { withDraft? })—{ itemId, versionTag }pairs.getFoldersBatch(folderIds)— for a known set of ids;listFolders({ projectId })still covers the whole tree.Shared behaviour:
STORAGE_BATCH_MAX(100) are split into several requests automatically, so callers never have to think about the ceiling.errorinstead of data.[]without touching the network.Also adds
src/types/batch.ts(mirrors the backend types), abatch-reads.tsexample, and a changeset.Related