Skip to content

Commit 1f7a408

Browse files
SLVS-1687 Make sure server issue store is reset, when no server information is available
1 parent e7a2044 commit 1f7a408

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ConnectedMode.UnitTests/Suppressions/SuppressionIssueStoreUpdaterTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void MefCtor_CheckIsExported()
5151
[DataRow(null, null)]
5252
[DataRow(null, "branch")]
5353
[DataRow("projectKey", null)]
54-
public async Task UpdateAll_MissingServerQueryInfo_NoOp(string projectKey, string branchName)
54+
public async Task UpdateAll_MissingServerQueryInfo_ResetsStore(string projectKey, string branchName)
5555
{
5656
// Server query info is not available -> give up
5757
var queryInfo = CreateQueryInfoProvider(projectKey, branchName);
@@ -64,7 +64,8 @@ public async Task UpdateAll_MissingServerQueryInfo_NoOp(string projectKey, strin
6464

6565
queryInfo.Verify(x => x.GetProjectKeyAndBranchAsync(It.IsAny<CancellationToken>()), Times.Once());
6666
server.Invocations.Should().HaveCount(0);
67-
writer.Invocations.Should().HaveCount(0);
67+
writer.Verify(x => x.Reset(), Times.Once);
68+
writer.Invocations.Should().HaveCount(1);
6869
}
6970

7071
[TestMethod]

src/ConnectedMode/Suppressions/SuppressionIssueStoreUpdater.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ await actionRunner.RunAsync(async token =>
9999

100100
if (queryInfo.projectKey == null || queryInfo.serverBranch == null)
101101
{
102+
storeWriter.Reset();
102103
return;
103104
}
104105

0 commit comments

Comments
 (0)