{"record":{"id":"3e3dd2ac564380ea","repo":"gitbutlerapp/gitbutler","slug":"raw-id-no-found","errorCode":null,"errorMessage":"'{raw_id}' no found","messagePattern":"'(.+?)' no found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/utils/diff_rendering.rs","lineNumber":1161,"sourceCode":"\nfn filter_uncommitted_hunks<'a, F>(\n    ctx: &'a Context,\n    id_map: &'a IdMap,\n    mut filter: F,\n) -> anyhow::Result<Vec<(&'a str, Arc<CliId>, &'a UncommittedHunk)>>\nwhere\n    F: FnMut(&but_core::SingleHunk) -> bool,\n{\n    let mut uncommitted_hunks = id_map\n        .uncommitted_hunks\n        .iter()\n        .filter(move |(_, hunk)| filter(&hunk.hunk))\n        .map(|(raw_id, hunk)| {\n            let mut cli_ids = id_map.parse_using_context(raw_id, ctx)?;\n            if cli_ids.len() == 1 {\n                Ok((&**raw_id, Arc::new(cli_ids.remove(0)), hunk))\n            } else if cli_ids.is_empty() {\n                bail!(\"'{raw_id}' no found\")\n            } else {\n                bail!(\n                    \"'{raw_id}' resolved to more than one hunk ({})\",\n                    cli_ids.len()\n                )\n            }\n        })\n        .collect::<anyhow::Result<Vec<_>>>()?;\n\n    uncommitted_hunks.sort_by(|(id_a, _, hunk_a), (id_b, _, hunk_b)| {\n        (\n            &hunk_a.hunk.path,\n            hunk_a\n                .hunk\n                .hunk_header\n                .as_ref()\n                .map(|header| header.old_start),\n            id_a,","sourceCodeStart":1143,"sourceCodeEnd":1179,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/utils/diff_rendering.rs#L1143-L1179","documentation":"filter_uncommitted_hunks re-parses every raw hunk id from the IdMap against the current diff context (parse_using_context). An empty result means the id matches no CLI hunk anymore - the worktree changed between listing and selection. The message's 'no found' means 'not found'.","triggerScenarios":"Listing hunk ids, then modifying/staging/reverting files before selecting one; a concurrent process (editor, formatter, another but invocation) alters the worktree; ids come from a stale listing.","commonSituations":"Interactive hunk-selection flows (squash/discard) where the user edits files mid-session, long-lived shells holding old ids, CI retrying an operation after files changed.","solutions":["Re-run the listing command to get fresh hunk ids, then retry the selection","Ensure no file changes happen between listing and selecting hunks","If another process touched the worktree, let it finish, then refresh the ids"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match filter_uncommitted_hunks(ctx, &id_map, filter) {\n    Err(e) if e.to_string().contains(\"no found\") => {\n        // worktree changed: recompute IdMap, re-list hunk ids, reselect once\n    }\n    r => r,\n}","preventionTips":["Re-resolve ids in the same operation that listed them","Treat any worktree write as invalidating cached hunk ids","When this fires, show the user a fresh listing instead of the raw error"],"tags":["diff","hunk","stale-id","worktree","cli"],"backgroundTag":"stale-diff-hunk-id","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}