{"record":{"id":"0f3254e4079edc28","repo":"zed-industries/zed","slug":"add","errorCode":null,"errorMessage":"add","messagePattern":"add","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fs/src/fs_watcher.rs","lineNumber":1612,"sourceCode":"    fn watch_key_folds_unicode_normalization_on_macos() {\n        // \"Café\" precomposed (NFC) vs decomposed (NFD) are different byte\n        // sequences but the same directory on a normalization-insensitive volume.\n        let nfc = Path::new(\"/repo/Caf\\u{00e9}\");\n        let nfd = Path::new(\"/repo/Cafe\\u{0301}\");\n        assert_ne!(nfc, nfd);\n        assert_eq!(\n            WatchKey::folded(SanitizedPath::new(nfc)),\n            WatchKey::folded(SanitizedPath::new(nfd)),\n        );\n    }\n\n    #[test]\n    fn case_insensitive_registration_matches_differently_cased_event() {\n        let (fired, cb) = fired_count();\n        let watcher = test_os_watcher(OsWatcherKind::Native, Some(Default::default()));\n        watcher\n            .add(Path::new(\"/Repo/Project\").into(), true, cb)\n            .expect(\"add\")\n            .expect(\"registered\");\n\n        // Event arrives lowercased (as TSGO/macOS may report it).\n        watcher.dispatch(Ok(modify_event(\"/repo/project/file.txt\")));\n        assert_eq!(*fired.lock(), 1);\n    }\n\n    #[test]\n    fn case_insensitive_registration_survives_case_only_rename() {\n        let (fired, cb) = fired_count();\n        let watcher = test_os_watcher(OsWatcherKind::Native, Some(Default::default()));\n        watcher\n            .add(Path::new(\"/Repo/Proj\").into(), true, cb)\n            .expect(\"add\")\n            .expect(\"registered\");\n\n        // The watched directory was renamed to a different casing; events now\n        // arrive under the new spelling.","sourceCodeStart":1594,"sourceCodeEnd":1630,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/fs/src/fs_watcher.rs#L1594-L1630","documentation":"Trace log from the fs_watcher test suite recording that a watch was added for a directory. In the test watch_key_folds_unicode_normalization_on_macos this fires when the watcher registers a path like /repo/Café; on macOS the registration key is Unicode-normalization-folded (NFC vs NFD) so later events for the same directory match the watch even though the byte sequences differ.","triggerScenarios":"Thrown at crates/fs/src/fs_watcher.rs:1612 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; this confirms the watch was added","If registration fails, confirm the path exists and is a directory","On macOS rely on the normalization-folding of WatchKey rather than raw path comparison"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}