fix(web): refresh the current branch when opening the picker #22807
MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/22807/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- apps/server/src/vcs/VcsStatusBroadcaster.ts lines 515 to 517OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -507,5 +510,8 @@507510508511 const refreshStatus: VcsStatusBroadcaster["Service"]["refreshStatus"] = Effect.fn(509512 "VcsStatusBroadcaster.refreshStatus",510- )(function* (rawCwd) {513+ )(function* (rawCwd, options) {511514 const cwd = yield* withFileSystem(normalizeCwd(rawCwd));515+ if (options?.localOnly) {516+ const local = yield* refreshLocalStatusCore(cwd);517+ return mergeGitStatusParts(local, null);
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/vcs/VcsStatusBroadcaster.ts line 527OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -507,5 +510,18 @@507510508511 const refreshStatus: VcsStatusBroadcaster["Service"]["refreshStatus"] = Effect.fn(509512 "VcsStatusBroadcaster.refreshStatus",510- )(function* (rawCwd) {513+ )(function* (rawCwd, options) {511514 const cwd = yield* withFileSystem(normalizeCwd(rawCwd));515+ if (options?.localOnly) {516+ return yield* withRemoteWriteLock(517+ cwd,518+ Effect.gen(function* () {519+ yield* workflow.invalidateLocalStatus(cwd);520+ const local = yield* workflow.localStatus({ cwd });521+ const previous = yield* getCachedStatus(cwd);522+ if (previous?.local?.value.refName !== local.refName) {523+ yield* workflow.invalidateRemoteStatus(cwd);524+ return yield* updateCachedStatus(cwd, local, null, { publish: true });525+ }526+ yield* updateCachedLocalStatus(cwd, local, { publish: true });527+ return mergeGitStatusParts(local, null);
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed