toeverything/AFFiNE · error
Invalid snapshot
Error message
Invalid snapshot
What it means
snapshotFetcher throws when the snapshot API responded ok but the returned arrayBuffer is empty, meaning the server returned an empty body for the requested history snapshot — the data is unusable for page-history preview.
Source
Thrown at packages/frontend/core/src/components/affine/page-history-modal/data.ts:96
workspaceId: string,
pageDocId: string,
ts: string,
] // timestamp is the key to the history/snapshot
) => {
if (!ts) {
return null;
}
const res = await fetchService.fetch(
`/api/workspaces/${workspaceId}/docs/${pageDocId}/histories/${ts}`
);
if (!res.ok) {
throw new Error('Failed to fetch snapshot');
}
const snapshot = await res.arrayBuffer();
if (!snapshot) {
throw new Error('Invalid snapshot');
}
return snapshot;
};
// attach the Page shown in the modal to a temporary workspace
// so that we do not need to worry about providers etc
// TODO(@Peng): fix references to the page (the referenced page will shown as deleted)
// if we simply clone the current workspace, it maybe time consuming right?
const docCollectionMap = new Map<string, Workspace>();
// assume the workspace is a cloud workspace since the history feature is only enabled for cloud workspace
const getOrCreateShellWorkspace = (
workspaceId: string,
flavourProvider?: WorkspaceFlavourProvider
) => {
let docCollection = docCollectionMap.get(workspaceId);
if (!docCollection) {
docCollection = new WorkspaceImpl({View on GitHub (pinned to b4c8548c09)
Solutions
- The snapshot data is corrupt or incompatible; pick another history entry.
- Re-fetch the snapshot list and retry.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown in the page history snapshotFetcher when the response arrayBuffer is falsy, meaning the server returned an empty or invalid snapshot payload.
Common situations: Occurs when a history entry loads but contains no snapshot data. Try another timestamp or report a corrupted history record.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/fda81a580c3eb8af.
Report an issue: GitHub.