Skip to content

Fix "Branches are all up to date" error toast on integrate upstream#13713

Merged
mtsgrd merged 1 commit into
masterfrom
guard-undefined-branch-statuses
May 9, 2026
Merged

Fix "Branches are all up to date" error toast on integrate upstream#13713
mtsgrd merged 1 commit into
masterfrom
guard-undefined-branch-statuses

Conversation

@mtsgrd
Copy link
Copy Markdown
Contributor

@mtsgrd mtsgrd commented May 8, 2026

Users clicking "integrate upstream" when branches were already current got an error toast instead of a silent no-op.

The integrate_upstream function in upstream_integration.rs matches on StackStatuses::UpdatesRequired and the else arm (the UpToDate case) called bail!("Branches are all up to date"), which surfaced as an error toast in the frontend.

Being up-to-date is a valid state, not an error. Replaced the bail!() with Ok(IntegrationOutcome { deleted_branches: vec![] }) so the frontend handles it silently.

@mtsgrd mtsgrd force-pushed the guard-undefined-branch-statuses branch from be1a696 to 1affbb0 Compare May 9, 2026 08:48
@github-actions github-actions Bot added the rust Pull requests that update Rust code label May 9, 2026
@mtsgrd mtsgrd changed the title Fix TypeError crash when upstream integration status fetch fails Guard against undefined branch statuses and stale workspace state May 9, 2026
@mtsgrd mtsgrd force-pushed the guard-undefined-branch-statuses branch 2 times, most recently from 0ab01b8 to dad42e7 Compare May 9, 2026 19:00
@mtsgrd mtsgrd changed the title Guard against undefined branch statuses and stale workspace state Fix "Branches are all up to date" error toast on integrate upstream May 9, 2026
Telemetry showed this was the most frequent error toast in v0.19.10.
Users clicking "integrate upstream" when branches were already current
got an error toast instead of a silent no-op.

The `integrate_upstream` function in `upstream_integration.rs` matches on
`StackStatuses::UpdatesRequired` and the else arm (the `UpToDate` case)
called `bail!()`, which surfaced as an error toast in the frontend.

Being up-to-date is a valid state, not an error. Replaced the `bail!()`
with `Ok(IntegrationOutcome { deleted_branches: vec![] })` so the
frontend handles it silently.
@mtsgrd mtsgrd force-pushed the guard-undefined-branch-statuses branch from dad42e7 to d3c2541 Compare May 9, 2026 20:13
@mtsgrd mtsgrd marked this pull request as ready for review May 9, 2026 20:59
Copilot AI review requested due to automatic review settings May 9, 2026 20:59
@mtsgrd mtsgrd merged commit 9696258 into master May 9, 2026
39 checks passed
@mtsgrd mtsgrd deleted the guard-undefined-branch-statuses branch May 9, 2026 20:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an incorrect error surfaced to users when triggering “integrate upstream” while the workspace/base branch is already current, treating “up-to-date” as a valid no-op outcome instead of an error.

Changes:

  • Update integrate_upstream to return a successful no-op IntegrationOutcome when upstream integration statuses are UpToDate.
  • Prevent the “Branches are all up to date” condition from propagating as an error toast to the frontend.

Comment on lines 568 to +573
let statuses = upstream_integration_statuses(&context)?;

let StackStatuses::UpdatesRequired { statuses, .. } = statuses else {
bail!("Branches are all up to date")
return Ok(IntegrationOutcome {
deleted_branches: vec![],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@gitbutler/desktop rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants