Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web,server): the branch label no longer flips back after a switch #28575

MergedYuruzuu(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/28575/headmerged by juliusmarminge View on GitHub

Showing 6 changed files with 100 additions and 18 deletions (loading 3).

x
0 of 6 viewed, 6 left
43 additions and 0 deletionsapps/server/src/vcs/VcsStatusBroadcaster.test.tsModified
View file
@@ -1068,6 +1068,49 @@
+ it.effect("publishes a checkout's branch before returning, ahead of the remote read", () => {
+ const state: Parameters<typeof layerTestFor>[0] = {
+ currentLocalStatus: baseLocalStatus,
+ currentRemoteStatus: baseRemoteStatus,
+ 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 localPublished = yield* Deferred.make<VcsStatusLocalResult>();
+ const remotePublished = yield* Deferred.make<VcsStatusRemoteResult | null>();
+ yield* broadcaster.streamStatus({ cwd: "/repo", includeRemote: false }).pipe(
+ Stream.runForEach((event) => {
+ if (event._tag === "snapshot") return Deferred.succeed(subscribed, undefined);
+ if (event._tag === "localUpdated") return Deferred.succeed(localPublished, event.local);
+ return event.remote === null
+ ? Effect.void
+ : Deferred.succeed(remotePublished, event.remote);
+ }),
+ Effect.forkScoped,
+ );