fix(upload): reject exact duplicates at upload time and prevent duplicate mobile uploads
- Move duplicate check before task enqueue in ui_upload endpoint - Clean up temp file and return status "duplicate" for exact duplicates - Add URI-level dedup guard in mobile UploadScreen to prevent repeated uploads - Improve ShareContext URI normalization (collapse slashes, decode percent-encoding) - Guard +not-found.tsx effect against re-firing for the same pathname - Update mobile UploadResponse type and handlers for duplicate status - Update web frontend upload.js to show duplicate status - Update API and Configuration docs Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -110,7 +110,14 @@ export default function NotFoundScreen() {
|
||||
const router = useRouter();
|
||||
const { addPendingFile } = useShare();
|
||||
|
||||
// Guard: track which pathname has been handled so the effect does not
|
||||
// re-fire when `router` or `addPendingFile` change identity mid-navigation.
|
||||
const handledRef = React.useRef<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (handledRef.current === pathname) return; // already handled
|
||||
handledRef.current = pathname;
|
||||
|
||||
if (looksLikeFilePath(pathname)) {
|
||||
// Filesystem path from iOS "Open In…" – add the file to ShareContext
|
||||
// and redirect to the Upload tab. UploadScreen will pick up the
|
||||
|
||||
Reference in New Issue
Block a user