diff --git a/backend/app/processing/process_queue.py b/backend/app/processing/process_queue.py index 53d9924..3723f78 100644 --- a/backend/app/processing/process_queue.py +++ b/backend/app/processing/process_queue.py @@ -136,7 +136,7 @@ def process_task(process_id: int): process.started_at = datetime.utcnow() db.commit() - process_steps = process_repository.get_process_steps_with_asset_content(db, process.id, [ProcessStepStatus.PENDING.name, ProcessStepStatus.IN_PROGRESS.name]) + process_steps = process_repository.get_process_steps_with_asset_content(db, process.id, [ProcessStepStatus.PENDING.name, ProcessStepStatus.FAILED.name, ProcessStepStatus.IN_PROGRESS.name]) if not process_steps: raise Exception("No process found!") diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 2e21b9d..fbd2cd7 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -1,4 +1,3 @@ -/** @type {import('next').NextConfig} */ const nextConfig = { async rewrites() { return [ @@ -12,6 +11,16 @@ const nextConfig = { }, ]; }, + + webpack(config) { + config.module.rules.push({ + test: /\.mjs$/, + exclude: /pdf\.worker\.min\.mjs$/, // Exclude pdf.worker.min.mjs from processing + type: "javascript/auto", + }); + + return config; + }, }; export default nextConfig; diff --git a/frontend/src/ee/components/HighlightPdfViewer.tsx b/frontend/src/ee/components/HighlightPdfViewer.tsx index 55073c4..0f30c18 100644 --- a/frontend/src/ee/components/HighlightPdfViewer.tsx +++ b/frontend/src/ee/components/HighlightPdfViewer.tsx @@ -100,15 +100,17 @@ const HighlightPdfViewer: React.FC = ({ highlightLayer.className = styles.highlightLayer; pageContainer.appendChild(highlightLayer); + const pixelRatio = window.devicePixelRatio || 1; + sources.forEach((source) => { const highlightDiv = document.createElement("div"); // Set the position and size of the highlight highlightDiv.style.position = "absolute"; - highlightDiv.style.left = `${source.x / 2}px`; - highlightDiv.style.top = `${source.y / 2}px`; - highlightDiv.style.width = `${source.width / 2}px`; - highlightDiv.style.height = `${source.height / 2}px`; + highlightDiv.style.left = `${source.x / pixelRatio}px`; + highlightDiv.style.top = `${source.y / pixelRatio}px`; + highlightDiv.style.width = `${source.width / pixelRatio}px`; + highlightDiv.style.height = `${source.height / pixelRatio}px`; highlightDiv.style.backgroundColor = "rgba(255, 255, 0, 0.3)"; // Yellow highlight highlightDiv.style.pointerEvents = "none"; // Allow interactions with underlying text highlightDiv.classList.add(styles.highlightDiv);