{"record":{"id":"86028d23715acc27","repo":"zed-industries/zed","slug":"add-watch","errorCode":null,"errorMessage":"add watch","messagePattern":"add watch","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fs/src/fs_watcher.rs","lineNumber":1776,"sourceCode":"\n    #[test]\n    #[cfg(target_os = \"windows\")]\n    fn event_dispatches_when_reported_path_has_verbatim_prefix() {\n        // `notify` (and Windows APIs generally) can report a changed path using the\n        // verbatim `\\\\?\\` long-path form even when the directory was registered\n        // without it.\n        let backend = Arc::new(Mutex::new(FakeWatchBackend::default()));\n        let watcher = test_os_watcher(OsWatcherKind::Native, Some(backend));\n        let fired = Arc::new(Mutex::new(Vec::new()));\n        {\n            let fired = fired.clone();\n            watcher\n                .add(\n                    Arc::<Path>::from(Path::new(\"C:\\\\repo\\\\src\")),\n                    false,\n                    move |_| fired.lock().push(()),\n                )\n                .expect(\"add watch\")\n                .expect(\"watch registered\");\n        }\n\n        watcher.dispatch(Ok(modify_event(\"\\\\\\\\?\\\\C:\\\\repo\\\\src\\\\main.rs\")));\n\n        assert_eq!(fired.lock().len(), 1);\n    }\n\n    #[test]\n    fn test_coalesce_pending_rescans() {\n        let test_cases = [\n            TestCase {\n                name: \"coalesces descendant rescans under pending ancestor\",\n                pending_paths: vec![rescan(\"/root\")],\n                path_events: vec![rescan(\"/root/child\"), rescan(\"/root/child/grandchild\")],\n                expected_pending_paths: vec![rescan(\"/root\")],\n                expected_path_events: vec![],\n            },","sourceCodeStart":1758,"sourceCodeEnd":1794,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/fs/src/fs_watcher.rs#L1758-L1794","documentation":"Trace log from the Windows-specific fs_watcher test event_dispatches_when_reported_path_has_verbatim_prefix, recorded when a watch is added. It confirms registration of a directory without the \\\\?\\ verbatim prefix, so the test can assert that a change event reported by notify/Windows using the \\\\?\\ long-path form still dispatches to the callback for the non-verbatim registered path.","triggerScenarios":"Thrown at crates/fs/src/fs_watcher.rs:1776 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No fix required; the log indicates the watch was added successfully","If events are missed on Windows, strip the \\\\?\\ verbatim prefix from reported paths before matching against registered watches","Ensure long paths are handled consistently between registration and event reporting"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-09-12T19:35:53.743Z","contentChangedAt":"2026-09-12T19:35:53.743Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}