Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): refresh the current branch when opening the picker #22807

MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/22807/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 136 additions and 3 deletions (loading 2).

x
0 of 5 viewed, 5 left
113 additions and 0 deletionsapps/server/src/vcs/VcsStatusBroadcaster.test.tsModified
View file
@@ -156,6 +156,119 @@
​
describe("VcsStatusBroadcaster", () => {
+ it.effect("publishes a terminal branch switch without reading remote status", () => {
+ const state = {
+ currentLocalStatus: baseLocalStatus,
+ currentRemoteStatus: remoteStatusWithPr,
+ localStatusCalls: 0,
+ remoteStatusCalls: 0,
+ localInvalidationCalls: 0,
+ remoteInvalidationCalls: 0,
+ };
+​
+ return Effect.gen(function* () {
+ const broadcaster = yield* VcsStatusBroadcaster.VcsStatusBroadcaster;
+ yield* broadcaster.getStatus({ cwd: "/repo" });
+ const subscribed = yield* Deferred.make<void>();
+ const events = yield* broadcaster.streamStatus({ cwd: "/repo", includeRemote: false }).pipe(
+ Stream.tap((event) =>
+ event._tag === "snapshot" ? Deferred.succeed(subscribed, undefined) : Effect.void,
+ ),
+ Stream.take(2),
+ Stream.runCollect,
+ Effect.forkScoped,
+ );
+ yield* Deferred.await(subscribed);
+​
+ state.currentLocalStatus = { ...baseLocalStatus, refName: "main" };
+ const refreshed = yield* broadcaster.refreshStatus("/repo", { localOnly: true });