mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: QA sweep -- SSE crash, memory leaks, HEIC Docker decode, TGA detection, lint cleanup
- Fix SSE write-after-end crash in progress.ts (remove callback before ending stream) - Fix blob URL memory leaks: revoke processedPreviewUrl and old HEIC preview URLs - Add AbortController to batch fetch in use-tool-processor and use-pipeline-processor - Fix TGA format misidentified as CUR (extension overrides magic bytes) - Add libheif-plugin-libde265 to Docker for HEIC/HEIF decode support - Remove unused imports and state (AppLayout, setSampledColor, useEffect) - Fix non-null assertions in meme-text-renderer and meme-generator - Fix confusing void type in meme-templates - Remove unnecessary useEffect deps in adjustments-panel - Fix Playwright strict mode violations in 5 E2E tests
This commit is contained in:
@@ -254,12 +254,20 @@ export async function registerProgressRoutes(app: FastifyInstance): Promise<void
|
||||
listeners.set(jobId, new Set());
|
||||
}
|
||||
|
||||
let ended = false;
|
||||
const callback = (data: JobProgress | SingleFileProgress) => {
|
||||
if (ended) return;
|
||||
sendEvent(data);
|
||||
if (
|
||||
("status" in data && (data.status === "completed" || data.status === "failed")) ||
|
||||
("phase" in data && (data.phase === "complete" || data.phase === "failed"))
|
||||
) {
|
||||
ended = true;
|
||||
const subs = listeners.get(jobId);
|
||||
if (subs) {
|
||||
subs.delete(callback);
|
||||
if (subs.size === 0) listeners.delete(jobId);
|
||||
}
|
||||
reply.raw.end();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user