Skip to content

[BR-2165]:feat/add multipart download for shared files - #2040

Open
jaaaaavier wants to merge 1 commit into
masterfrom
feat/add-multipart-download-for-shared-files
Open

[BR-2165]:feat/add multipart download for shared files#2040
jaaaaavier wants to merge 1 commit into
masterfrom
feat/add-multipart-download-for-shared-files

Conversation

@jaaaaavier

@jaaaaavier jaaaaavier commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds multipart download support to public shared file links.

Changes:

  • NetworkFacade.downloadChunk: honor options?.key as an override for the SDK-derived decryption key, mirroring the existing behavior in download(). Needed because shared links have no mnemonic to derive a key from the real key is the link's own encryptionKey.
  • download/v2.ts: split multipartDownload into multipartDownloadOwnFile (existing behavior) and a new multipartDownloadSharedFile, dispatching on token && encryptionKey, the same discriminator already used by downloadFile() for the non-multipart case.
  • network/index.ts: re-export multipartDownloadFile from the network facade so it's actually reachable from views (it already existed in download.ts but wasn't exposed).
  • ShareFileView.tsx: use network.multipartDownloadFile when fileInfo.item.size >= MIN_DOWNLOAD_MULTIPART_SIZE, otherwise keep the regular single-request downloadFile`.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Manually verified in the browser: shared files above the threshold trigger multiple parallel 206 Partial Content range requests instead of one single request, and the resulting file downloads and decrypts correctly.

Additional Notes

@jaaaaavier jaaaaavier self-assigned this Jul 13, 2026
@jaaaaavier jaaaaavier added the enhancement New feature or request label Jul 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jaaaaavier
jaaaaavier marked this pull request as ready for review July 14, 2026 06:28
@jaaaaavier
jaaaaavier requested review from a team, CandelR and larryrider as code owners July 14, 2026 06:28
(downloadFile as any).mockImplementation(
async (fileId, bucketId, mnemonic, network, cryptoLib, bufferFrom, downloadCallback, decryptCallback) => {
await downloadCallback([{ url: downloadExample }]);
await decryptCallback('aes256ctr', sdkDerivedKey, iv, 2048);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be called with the overrideKey?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants