-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Bug Report: Screenshot File Access Fails for Synced Data with EncryptedBlockstore Errors
Summary
File attachments (screenshots) work for local data but fail to load for synced data with EncryptedBlockstore
errors and "car not ready" messages when using toCloud()
attachment.
Environment
- Fireproof Version: v0.23.0 (UPGRADE BRANCH)
- Application: Vibes DIY catalog system
- Browser: Chrome
- Sync: Using
toCloud()
attachment for authenticated users
Symptoms
Working Case (Local Data)
- Vibe ID:
fmehjlyodri54k8rfr
- Result: ✅
Screenshot size: 34731 bytes
- Display: File attachment renders correctly in UI
- Database: Local-only (
userId = 'local'
, no toCloud attachment)
Failing Cases (Synced Data)
- Vibe IDs:
fmehj91sfrrqff8cg8
,fmehj9hy1pwdy0ddrx
- Error:
Failed to get Screenshot size: Error: {"module":"EncryptedBlockstore"...}
- Display: File attachments don't render (fail silently)
- Database: Cloud-synced data (
userId = 'zs4m1mTYGk5LvSRsw'
, with toCloud attachment)
Code Context
The error occurs when calling file()
method on Fireproof file attachments:
// In React component - accessing synced file attachment
if (doc._files?.screenshot) {
doc._files.screenshot.file().then((file: File) => {
console.log(`Screenshot size: ${file.size}`);
}).catch((error: Error) => {
console.error(`Failed to get Screenshot size:`, error);
});
}
Database Configuration
// Conditional toCloud() attachment based on userId
const { database, useAllDocs } = useFireproof(dbName,
userId && userId !== 'local' ? { attach: toCloud() } : {}
);
Console Error Details
[ERROR] {module: EncryptedBlockstore, this: z2z4uNe, level: error, cid: baembeigd3itv3ao4ub2xrid25e5...}
[ERROR] {module: EncryptedBlockstore, this: z2z4uNe, level: error, cid: baembeic6lyzpazbufr6wutswdys...}
[ERROR] Failed to get Screenshot size for fmehj91sfrrqff8cg8: Error: {"module":"EncryptedBlockstore"...}
[ERROR] Failed to get Screenshot size for fmehj9hy1pwdy0ddrx: Error: {"module":"EncryptedBlockstore"...}
Multiple failing CIDs with prefixes: baembeigd3itv3ao4ub2xrid25e5
, baembeic6lyzpazbufr6wutswdys
, various bafkr
CIDs.
Expected Behavior
File attachments should be accessible via file()
method regardless of whether data is local or synced via toCloud()
.
Actual Behavior
- ✅ Local file attachments work correctly
- ❌ Synced file attachments throw
EncryptedBlockstore
errors - ❌ "car not ready" messages suggest CAR (Content Addressable aRchive) format issues
- ❌ File attachment data becomes inaccessible after sync
Reproduction Steps
- Create document with file attachment locally (works fine)
- Enable cloud sync using
toCloud()
attachment - Access file attachment via
doc._files.attachmentName.file()
(fails) - Observe EncryptedBlockstore errors in console
Impact
- File attachments become inaccessible after cloud sync
- Breaks user experience for cloud-synced applications
- Suggests broader file attachment synchronization issues
Questions
- Is there a known issue with file attachment sync in v0.23.0 upgrade branch?
- Are CAR format files properly handled during
toCloud()
sync? - Should
EncryptedBlockstore
errors be expected for synced content? - Is there a different API for accessing synced file attachments?
- Are there any workarounds for accessing synced file data?
Additional Context
This issue affects the Vibes DIY application where screenshots are stored as Fireproof file attachments. The problem only manifests when using cloud sync - local-only databases work perfectly.
Metadata
Metadata
Assignees
Labels
No labels