Skip to content

feat(client): add getHiddenFileSignedUrl for ranged streaming#22

Merged
agviegas merged 3 commits into
mainfrom
feat/hidden-file-signed-url
Jun 29, 2026
Merged

feat(client): add getHiddenFileSignedUrl for ranged streaming#22
agviegas merged 3 commits into
mainfrom
feat/hidden-file-signed-url

Conversation

@agviegas

Copy link
Copy Markdown
Contributor

What

Adds EngineServicesClient.getHiddenFileSignedUrl(hiddenId, expiresIn?).

const { url, expiresAt } = await client.getHiddenFileSignedUrl(hiddenId);
// fetch ranges directly:
const res = await fetch(url, { headers: { Range: "bytes=0-65535" } }); // 206

Why

downloadHiddenFile() streams the whole object. For very large hidden files — e.g. a point cloud's octree.bin that a viewer reads in small [offset, length] slices — downloading the entire file isn't viable. This method returns a short-lived signed URL the browser can fetch directly with native HTTP Range requests, so the renderer pulls only the bytes it needs.

Notes

  • Returns { url, expiresAt }. expiresAt is an ISO timestamp; re-call to refresh the URL when it nears/passes expiry. Optional expiresIn (seconds) requests a specific lifetime.
  • Read-only; complements the existing downloadHiddenFile() (still the right call for whole small files).

Testing

  • tsc --noEmit green.

agviegas and others added 2 commits June 27, 2026 17:20
Adds EngineServicesClient.getHiddenFileSignedUrl(hiddenId, expiresIn?), which
returns a short-lived signed URL ({ url, expiresAt }) for a hidden file. This
lets the browser fetch large hidden files directly with native HTTP Range
requests (e.g. streaming a point cloud's octree.bin) instead of downloading
the whole object. Re-call to refresh the URL when it nears expiry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
package.json declares three (dep + peer) as >=0.182.0, but the committed
lockfile was keyed three@^0.182.0 at 0.182.0 — a pre-existing mismatch that
makes `yarn install --frozen-lockfile` fail on CI. Regenerates the lockfile so
the key matches and three resolves to 0.185.0 (latest satisfying the range).
three is a peer dep, so this only affects the repo's own build/test, not
consumers. tsc stays green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@agviegas agviegas merged commit 5c38be7 into main Jun 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants