mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: harden Docker image and async job responses
Harden Docker runtime packaging, preserve async job response semantics, fix Redis subscriber startup connections, clear lint warnings, and harden enterprise S3 object body handling.
This commit is contained in:
@@ -42,14 +42,15 @@ export function DocumentView({ inputOnly = false }: { inputOnly?: boolean } = {}
|
||||
// F22: when processedUrl is available, use URL-based loading instead of
|
||||
// entry.file (which is the original non-PDF input and would fail pdf.js)
|
||||
const file = hasProcessedUrl ? undefined : entry?.file;
|
||||
if (!file && !src) return;
|
||||
const url = src;
|
||||
if (!file && !url) return;
|
||||
let cancelled = false;
|
||||
let doc: pdfjs.PDFDocumentProxy | undefined;
|
||||
let renderTask: pdfjs.RenderTask | undefined;
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const source = file ? { data: new Uint8Array(await file.arrayBuffer()) } : { url: src! };
|
||||
const source = file ? { data: new Uint8Array(await file.arrayBuffer()) } : { url };
|
||||
doc = await pdfjs.getDocument(source).promise;
|
||||
if (cancelled) return;
|
||||
setPageCount(doc.numPages);
|
||||
|
||||
Reference in New Issue
Block a user