fix: resolve file library Open File bug, upload reliability, and SSE proxy timeouts (#203)

The Open File button in the Files section did nothing due to a race
condition where the home page reset the file store on mount before files
from handleOpenFile could render. Upload on the files page used fetch
with no timeout, progress, or retry, causing silent failures on mobile
and slow connections. SSE connections for job progress had no keepalive
pings, allowing reverse proxies to kill idle streams.
This commit is contained in:
SnapOtter
2026-06-05 19:01:40 +08:00
committed by GitHub
parent f1aae73397
commit 01421640b5
9 changed files with 176 additions and 44 deletions
+8 -3
View File
@@ -1,7 +1,7 @@
import { CATEGORIES, PYTHON_SIDECAR_TOOLS, TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared";
import { Clock, Download, Loader2 } from "lucide-react";
import { useCallback, useEffect, useMemo } from "react";
import { useNavigate } from "react-router-dom";
import { useLocation, useNavigate } from "react-router-dom";
import { ImageViewer } from "@/components/common/image-viewer";
import { MultiImageViewer } from "@/components/common/multi-image-viewer";
import { AppLayout } from "@/components/layout/app-layout";
@@ -29,12 +29,17 @@ export function HomePage() {
currentEntry,
} = useFileStore();
const navigate = useNavigate();
const location = useLocation();
const { fetch: fetchSettings, defaultToolView, loaded: settingsLoaded } = useSettingsStore();
const { fetch: fetchFeatures, bundles, installing, queued } = useFeaturesStore();
useEffect(() => {
reset();
}, [reset]);
if (location.state?.fromLibrary) {
navigate(".", { replace: true, state: {} });
} else {
reset();
}
}, [reset, location.state, navigate]);
useEffect(() => {
fetchSettings();