{"record":{"id":"142bea57f6cc62ac","repo":"Zackriya-Solutions/meetily","slug":"file-does-not-exist","errorCode":null,"errorMessage":"File does not exist: {}","messagePattern":"File does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"frontend/src-tauri/src/audio/import.rs","lineNumber":124,"sourceCode":"    pub message: String,\n}\n\n/// Check if import is currently in progress\npub fn is_import_in_progress() -> bool {\n    IMPORT_IN_PROGRESS.load(Ordering::SeqCst)\n}\n\n/// Cancel ongoing import\npub fn cancel_import() {\n    IMPORT_CANCELLED.store(true, Ordering::SeqCst);\n}\n\n/// Validate an audio file and return its info using metadata-only approach\n/// Falls back to full decode if metadata is unavailable\npub fn validate_audio_file(path: &Path) -> Result<AudioFileInfo> {\n    // Check file exists\n    if !path.exists() {\n        return Err(anyhow!(\"File does not exist: {}\", path.display()));\n    }\n\n    // Check extension\n    let extension = path\n        .extension()\n        .and_then(|e| e.to_str())\n        .map(|e| e.to_lowercase())\n        .unwrap_or_default();\n\n    if !AUDIO_EXTENSIONS.contains(&extension.as_str()) {\n        return Err(anyhow!(\n            \"Unsupported format: .{}. Supported: {}\",\n            extension,\n            AUDIO_EXTENSIONS.join(\", \")\n        ));\n    }\n\n    // Get file size","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/import.rs#L106-L142","documentation":"validate_audio_file (import.rs:124) rejects a path because Path::exists() returned false before any format/size checks ran. This is the first guard of audio-file import validation, called when the user picks a file or a path is forwarded programmatically. exists() follows symlinks and returns false for broken links, but in practice the file really is absent by validation time.","triggerScenarios":"File deleted/moved between the file-dialog pick and the validate_audio_file invoke; a broken symlink selected via drag-and-drop; the frontend passed a fake-path from a web-style File object (WebView hands back C:\\fake_path names); a stale network mount or ejected external drive; a path string mangled by encoding/escaping across the Tauri IPC boundary.","commonSituations":"User picks from Recent Files but the file was renamed; importing from a USB drive unplugged mid-flow; paths copied from a browser download list after cleanup; non-ASCII/emoji filenames corrupted by shell quoting or JSON escaping.","solutions":["Re-open the file via the dialog and pick the current location; simplest and almost always correct.","If integrating programmatically, canonicalize the path right before invoking and surface the existence check in the UI (disable Import until the file exists).","For drag-and-drop, resolve the real filesystem path the drop event provides rather than a display path.","Compare the logged path.display() byte-for-byte with the real path (watch NFC/NFD Unicode normalization on macOS).","Handle the WebView fake-path case by using the dialog plugin rather than trusting file names."],"exampleFix":"// frontend: before - invoke with whatever string is at hand\nawait invoke('validate_audio_file', { path: fileNames[0] });\n\n// frontend: after - use the dialog plugin so the OS returns a real absolute path\nimport { open } from '@tauri-apps/plugin-dialog';\nconst picked = await open({ multiple: false });\nif (picked) await invoke('validate_audio_file', { path: picked });","handlingStrategy":"validation","validationCode":"// Frontend: resolve a real absolute path via the dialog before invoking\nimport { open } from '@tauri-apps/plugin-dialog';\nconst picked = await open({ multiple: false });\nif (!picked) throw new Error('no file selected');\nawait invoke('validate_audio_file', { path: picked });","typeGuard":"// TypeScript: reject obviously-invalid candidates before invoke\nconst looksLikeRealPath = (p: string) =>\n  p.length > 0 && !p.startsWith('C:\\\\fake_path') && /\\.[a-z0-9]{2,5}$/i.test(p);","tryCatchPattern":"// Map to a friendly file-moved prompt instead of a raw error\ntry { await invoke('validate_audio_file', { path }); }\ncatch (e) {\n  if (String(e).includes('does not exist')) promptRepickFile();\n  else throw e;\n}","preventionTips":["Always source paths from the OS dialog plugin, never from copied text or File.name in a WebView.","Import immediately after picking; do not stage paths across sessions.","For drag-and-drop, use the drop event's real path payload.","Watch NFC/NFD Unicode normalization when comparing logged vs actual paths on macOS."],"tags":["file","import","validation","file-not-found","tauri-ipc"],"backgroundTag":"file-not-found","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}