Skip to content

fix(encrypt-upload-client): load all CAR blocks into blockstore #659

Merged
fforbeck merged 2 commits intomainfrom
fix/file-decryption-2
Feb 5, 2026
Merged

fix(encrypt-upload-client): load all CAR blocks into blockstore #659
fforbeck merged 2 commits intomainfrom
fix/file-decryption-2

Conversation

@fforbeck
Copy link
Member

@fforbeck fforbeck commented Feb 5, 2026

Problem

File decryption was failing with "Not Found" errors during metadata extraction. The issue happened when the UnixFS exporter attempted to read encrypted data from the blockstore - it could find the root block but failed when trying to access child blocks, causing the entire decryption process to fail.

Root Cause

The encrypted data is stored as a UnixFS file that may be chunked into multiple blocks forming a DAG structure. The original implementation only loaded the root block into the in-memory blockstore. When the exporter tried to traverse the DAG to read the file content, it couldn't find the child blocks and threw "Not Found" errors.

Solution

Modified getEncryptedDataFromCar to load all blocks from the metadata CAR file into the blockstore, not just the root block. This ensures the exporter can successfully traverse the entire DAG structure and stream the encrypted data for decryption.

@fforbeck fforbeck self-assigned this Feb 5, 2026
@fforbeck fforbeck requested a review from travis as a code owner February 5, 2026 14:14
@fforbeck fforbeck merged commit 7a763ac into main Feb 5, 2026
1 check passed
fforbeck pushed a commit that referenced this pull request Feb 5, 2026
…9.95 (#661)

## @storacha/[email protected] (2026-02-05)

### 🩹 Fixes

- #659

### ❤️ Thank You

- Felipe Forbeck @fforbeck

## @storacha/[email protected] (2026-02-05)

### 🧱 Updated Dependencies

- Updated @storacha/encrypt-upload-client to 1.1.75

Co-authored-by: Rachabot <[email protected]>
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