Skip to content

Commit

Permalink
Merge pull request #5616 from gitbutlerapp/dont-mask-error
Browse files Browse the repository at this point in the history
Fail loudly if workspace state out of sync
  • Loading branch information
Caleb-T-Owens authored Nov 19, 2024
2 parents 1298431 + d12c1cb commit c421fd4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions apps/desktop/src/lib/vbranches/upstreamIntegrationService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { invoke } from '$lib/backend/ipc';
import { VirtualBranchService } from '$lib/vbranches/virtualBranch';
import { isDefined } from '@gitbutler/ui/utils/typeguards';
import { derived, readable, type Readable } from 'svelte/store';
import type { Project } from '$lib/backend/projects';
import type { VirtualBranch } from '$lib/vbranches/types';
Expand Down Expand Up @@ -135,18 +134,20 @@ export class UpstreamIntegrationService {

return {
type: 'updatesRequired',
subject: branchStatuses.subject
.map((status) => {
const stack = branches.find((appliedBranch) => appliedBranch.id === status[0]);

if (!stack) return;

return {
stack,
status: status[1]
};
})
.filter(isDefined)
subject: branchStatuses.subject.map((status) => {
const stack = branches.find((appliedBranch) => appliedBranch.id === status[0]);

if (!stack) {
throw new Error(
`Could not find stack with id ${status[0]}. Please report this issue and try restarting the app and trying again.`
);
}

return {
stack,
status: status[1]
};
})
};
}
);
Expand Down

0 comments on commit c421fd4

Please sign in to comment.