@@ -254,7 +254,6 @@ interface SyncData {
254254 ahead : number ;
255255 behind : number ;
256256 } ;
257- remoteBackendProjects : BackendProject [ ] ;
258257}
259258
260259const remoteBranchesCache : Record < string , string [ ] > = { } ;
@@ -320,27 +319,31 @@ export const syncDataLoader: LoaderFunction = async ({
320319 const vcs = VCSInstance ( ) ;
321320 const { syncItems } = await getSyncItems ( { workspaceId } ) ;
322321 const localBranches = ( await vcs . getBranchNames ( ) ) . sort ( ) ;
323- const remoteBranches = (
324- remoteBranchesCache [ workspaceId ] || ( await vcs . getRemoteBranchNames ( ) )
325- ) . sort ( ) ;
326322 const currentBranch = await vcs . getCurrentBranchName ( ) ;
327323 const history = ( await vcs . getHistory ( ) ) . sort ( ( a , b ) =>
328324 b . created > a . created ? 1 : - 1
329325 ) ;
330326 const historyCount = await vcs . getHistoryCount ( ) ;
331327 const status = await vcs . status ( syncItems ) ;
332- const compare =
328+
329+ let remoteBranches : string [ ] = [ ] ;
330+ let compare = { ahead : 0 , behind : 0 } ;
331+ try {
332+ remoteBranches = (
333+ remoteBranchesCache [ workspaceId ] || ( await vcs . getRemoteBranchNames ( ) )
334+ ) . sort ( ) ;
335+ compare =
333336 remoteCompareCache [ workspaceId ] || ( await vcs . compareRemoteBranch ( ) ) ;
334337 const remoteBackendProjects =
335338 remoteBackendProjectsCache [ workspaceId ] ||
336339 ( await vcs . remoteBackendProjects ( {
337340 teamId : project . parentId ,
338341 teamProjectId : project . remoteId ,
339342 } ) ) ;
340-
341343 remoteBranchesCache [ workspaceId ] = remoteBranches ;
342344 remoteCompareCache [ workspaceId ] = compare ;
343345 remoteBackendProjectsCache [ workspaceId ] = remoteBackendProjects ;
346+ } catch ( e ) { }
344347
345348 return {
346349 syncItems,
@@ -351,7 +354,6 @@ export const syncDataLoader: LoaderFunction = async ({
351354 historyCount,
352355 status,
353356 compare,
354- remoteBackendProjects,
355357 } ;
356358 } catch ( e ) {
357359 const errorMessage =
0 commit comments