Fix Invalid PDF structure after reload for uploaded documents.
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

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:
tegwick 2026-07-30 20:05:26 +02:00
parent 9dbe806487
commit a73d45bfac
3 changed files with 26 additions and 8 deletions

View file

@ -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,