Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): overlapping VCS status refreshes share one follow-up refresh #24478

Mergedonly21mil(GitHub profile, opens in a new tab)merged 11 commits intomain fromrefs/pull/24478/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 139 additions and 2 deletions.

x
0 of 2 viewed, 2 left
87 additions and 1 deletionapps/server/src/vcs/VcsStatusBroadcaster.test.tsModified
View file
@@ -80,7 +80,7 @@
remoteStatusError?: GitManagerError;
backgroundWorkEnabled?: boolean;
automaticFetchInterval?: Effect.Effect<Duration.Duration>;
- beforeRemoteStatus?: Effect.Effect<void>;
+ beforeRemoteStatus?: Effect.Effect<void, GitManagerError>;
beforeLocalStatus?: Effect.Effect<void>;
beforeCurrentBranch?: Effect.Effect<void>;
beforeInvalidate?: Effect.Effect<void>;
@@ -1724,6 +1724,92 @@
assert.isTrue(Option.isSome(yield* Deferred.poll(remoteInterrupted)));
}).pipe(Effect.provide(layerTest));
+​
+ it.effect("refreshes requested during a refresh share one follow-up refresh", () => {
+ 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;
+ const fetchStarted = yield* Deferred.make<void>();
+ const finishFetch = yield* Deferred.make<void>();
+ state.beforeRemoteStatus = Deferred.succeed(fetchStarted, undefined).pipe(