toeverything/AFFiNE · error · Error
Expected a single zip file for snapshot import
Error message
Expected a single zip file for snapshot import
What it means
Guard in the snapshot import config: a workspace snapshot import expects exactly one zip archive; any other selection size means there is no snapshot payload to restore, so the config throws before delegating to the snapshot importer.
Source
Thrown at packages/frontend/core/src/desktop/dialogs/import/index.tsx:406
const docIds: string[] = [];
for (const file of files) {
const docId = await DocxTransformer.importDocx({
collection: docCollection,
schema: getAFFiNEWorkspaceSchema(),
imported: file,
extensions: getStoreManager().config.init().value.get('store'),
});
if (docId) docIds.push(docId);
}
return { docIds };
},
},
snapshot: {
fileOptions: { acceptType: 'Zip', multiple: false },
importFunction: async ({ docCollection, files }) => {
const file = files.length === 1 ? files[0] : null;
if (!file) {
throw new Error('Expected a single zip file for snapshot import');
}
const docIds = (
await ZipTransformer.importDocs(
docCollection,
getAFFiNEWorkspaceSchema(),
file
)
)
.filter((doc): doc is NonNullable<typeof doc> => doc !== undefined)
.map(doc => doc.id);
return {
docIds,
};
},
},
dotaffinefile: {
fileOptions: { acceptType: 'Skip', multiple: false },View on GitHub (pinned to b4c8548c09)
Solutions
- Select exactly one zip snapshot file.
- Re-pick the file in the import dialog.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown by the snapshot import function when files.length is not exactly one, because ZipTransformer.importDocs consumes a single snapshot zip.
Common situations: A workspace snapshot import was started without selecting exactly one zip. Choose one previously exported AFFiNE snapshot zip file.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/39c7633bba843db7.
Report an issue: GitHub.