Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): opening the branch menu no longer wipes PR status #33263

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/33263/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 101 additions and 19 deletions.

x
0 of 2 viewed, 2 left
97 additions and 2 deletionsapps/server/src/vcs/VcsStatusBroadcaster.test.tsModified
View file
@@ -375,17 +375,19 @@
yield* Deferred.await(subscribed);
​
state.currentLocalStatus = { ...baseLocalStatus, refName: "main" };
+ state.currentRemoteStatus = baseRemoteStatus;
const refreshed = yield* broadcaster.refreshStatus("/repo", { localOnly: true });
assert.equal(refreshed.refName, "main");
assert.isNull(refreshed.pr);
assert.equal(state.localInvalidationCalls, 1);
assert.equal(state.remoteStatusCalls, 1);
- assert.equal(state.remoteInvalidationCalls, 2);
+ assert.equal(state.remoteInvalidationCalls, 1);
assert.deepStrictEqual((yield* Fiber.join(events)).slice(1), [
{ _tag: "remoteUpdated", remote: null },
{ _tag: "localUpdated", local: state.currentLocalStatus },
]);
assert.isNull((yield* broadcaster.getStatus({ cwd: "/repo" })).pr);
+ assert.equal(state.remoteStatusCalls, 2);
state.currentLocalStatus = { ...state.currentLocalStatus, hasWorkingTreeChanges: true };
yield* broadcaster.refreshLocalStatus("/repo");
state.currentLocalStatus = { ...baseLocalStatus, refName: "union" };
@@ -433,6 +435,98 @@
​
+ it.effect("a local-only refresh that overlaps the first remote poll keeps its PR", () => {
+ const state: Parameters<typeof layerTestFor>[0] = {
+ currentLocalStatus: baseLocalStatus,
+ currentRemoteStatus: remoteStatusWithPr,