{"record":{"id":"3b608df715e6efcf","repo":"gitbutlerapp/gitbutler","slug":"assignments-error-assignments-error-clone-dependencies-error","errorCode":null,"errorMessage":"assignments_error: assignments_error.clone() (dependencies_error: serde_error::Error::new(&**err))","messagePattern":"assignments_error: assignments_error\\.clone\\(\\) \\(dependencies_error: serde_error::Error::new\\(&\\*\\*err\\)\\)","errorType":"error_code","errorClass":"serde_error::Error","httpStatus":null,"severity":"info","filePath":"crates/gitbutler-watcher/src/handler.rs","lineNumber":134,"sourceCode":"            &repo,\n            &ws,\n            wt_changes.changes.clone(),\n            context_lines,\n        )?;\n\n        let mut worktree_changes: but_core::ui::WorktreeChanges = wt_changes.clone().into();\n        worktree_changes.modification_times =\n            but_core::diff::ui::modification_times(&repo, &worktree_changes);\n\n        let changes = but_hunk_assignment::WorktreeChanges {\n            worktree_changes,\n            assignments: assignments.clone(),\n            assignments_error: assignments_error.clone(),\n            dependencies: dependencies.as_ref().ok().cloned(),\n            dependencies_error: dependencies\n                .as_ref()\n                .err()\n                .map(|err| serde_error::Error::new(&**err)),\n        };\n        let _ = self.emit_app_event(Change::WorktreeChanges {\n            project_id,\n            changes,\n            changed_paths: Arc::from(paths),\n        });\n        Ok(())\n    }\n\n    pub fn git_files_change(\n        &self,\n        project_id: ProjectHandleOrLegacyProjectId,\n        paths: Vec<PathBuf>,\n        ctx: &mut Context,\n        perm: &mut RepoExclusive,\n    ) -> Result<()> {\n        let (head_ref_name, head_sha) = head_info(ctx)?;\n        let mut saw_workspace_activity = false;","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/gitbutler-watcher/src/handler.rs#L116-L152","documentation":"When the file watcher emits `WorktreeChanges`, hunk-assignment failures cannot be serialized as the original anyhow error chain, so `dependencies_error` (and analogously `assignments_error`) is converted via `serde_error::Error::new`. This preserves the top-level message for the UI while making the error serializable across the app-event boundary.","triggerScenarios":"A watcher tick computes worktree changes; the dependency computation inside `but_hunk_assignment::WorktreeChanges` fails (e.g. target resolution or file dependency analysis error), producing `dependencies_error` on the emitted event.","commonSituations":"Repository in a transient state during a rebase/checkout while the watcher fires; unresolved merge conflicts breaking dependency analysis; large or binary files failing dependency computation; git object access errors mid-scan.","solutions":["Read the message in `dependencies_error`/`assignments_error` on the emitted `Change::WorktreeChanges` event to see the root cause.","Wait for the next watcher tick — transient git states resolve themselves once operations finish.","Resolve merge conflicts or complete in-progress operations in the repository.","If persistent, re-open the project to rebuild watcher state."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"on_change(|change: Change| match change {\n    Change::WorktreeChanges { changes, .. } if changes.dependencies_error.is_some() => {\n        warn(\"dependency computation failed; waiting for next tick\");\n    }\n    _ => {}\n})","preventionTips":["Treat assignments_error/dependencies_error as advisory, not fatal — results may still be usable.","Complete in-progress git operations before trusting watcher output.","Resolve merge conflicts promptly to keep dependency analysis healthy."],"tags":["watcher","serialization","assignments","async"],"backgroundTag":"hunk-assignment-failed","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}