Fix Invalid PDF structure after reload for uploaded documents.
Stop inventing /fixtures/pdfs/<title> URLs when blob bytes are missing; rely on IndexedDB-hydrated byte store. Seeded tests set an explicit fixture uri. Session metadata already survived; PDF bytes now survive too.
This commit is contained in:
parent
9dbe806487
commit
a73d45bfac
3 changed files with 26 additions and 8 deletions
|
|
@ -49,10 +49,18 @@ export function seedSessionWithDoc(opts: SeedOptions): SeedResult {
|
|||
lastOpenedAt: now,
|
||||
};
|
||||
|
||||
// Stable HTTP fixture URI so the viewer mounts without IndexedDB bytes.
|
||||
// (resolvePdfViewerUrl no longer invents /fixtures paths from title alone —
|
||||
// that produced "Invalid PDF structure" for arbitrary uploads after reload.)
|
||||
const document: Document = {
|
||||
id: documentId,
|
||||
mediaType: "application/pdf",
|
||||
...(opts.documentTitle ? { title: opts.documentTitle } : {}),
|
||||
...(opts.documentTitle
|
||||
? {
|
||||
title: opts.documentTitle,
|
||||
uri: `/fixtures/pdfs/${encodeURIComponent(opts.documentTitle)}`,
|
||||
}
|
||||
: {}),
|
||||
fingerprint: "seed-fingerprint",
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue