Skip to content

Commit d59edfd

Browse files
committed
fix: Address Lint configuration errors
- Populate all PushKind enum values in IsMessageNotification switch - Remove unnecessary using directives (System, System.Collections.Generic) - Remove unused private fields (_callbackExceptions, _receivedMessages) - Fix xUnit2022: Use Assert.False instead of Assert.True with negation - Keep System.Diagnostics using for Stopwatch (not in implicit usings for Lint config) All lint errors resolved. Build passes with --configuration Lint. Signed-off-by: Joe Brinkman <[email protected]>
1 parent 600b48e commit d59edfd

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

sources/Valkey.Glide/BaseClient.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,19 @@ private void PubSubCallback(
228228
private static bool IsMessageNotification(PushKind pushKind) =>
229229
pushKind switch
230230
{
231-
PushKind.PushMessage => true, // Regular channel message
232-
PushKind.PushPMessage => true, // Pattern-based message
233-
PushKind.PushSMessage => true, // Sharded channel message
234-
_ => false // All other types are confirmations/notifications
231+
PushKind.PushMessage => true, // Regular channel message
232+
PushKind.PushPMessage => true, // Pattern-based message
233+
PushKind.PushSMessage => true, // Sharded channel message
234+
PushKind.PushDisconnection => false,
235+
PushKind.PushOther => false,
236+
PushKind.PushInvalidate => false,
237+
PushKind.PushUnsubscribe => false,
238+
PushKind.PushPUnsubscribe => false,
239+
PushKind.PushSUnsubscribe => false,
240+
PushKind.PushSubscribe => false,
241+
PushKind.PushPSubscribe => false,
242+
PushKind.PushSSubscribe => false,
243+
_ => false
235244
};
236245

237246
private static PubSubMessage MarshalPubSubMessage(

sources/Valkey.Glide/PubSubPerformanceConfig.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
22

3-
using System;
43
using System.Threading.Channels;
54

65
namespace Valkey.Glide;

sources/Valkey.Glide/PubSubSubscriptionConfig.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
22

3-
using System;
4-
using System.Collections.Generic;
5-
63
namespace Valkey.Glide;
74

85
/// <summary>

tests/Valkey.Glide.IntegrationTests/PubSubCallbackIntegrationTests.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
22

3-
using System.Collections.Concurrent;
43
using System.Diagnostics;
54

6-
using Valkey.Glide;
7-
85
namespace Valkey.Glide.IntegrationTests;
96

107
/// <summary>
@@ -16,8 +13,6 @@ namespace Valkey.Glide.IntegrationTests;
1613
public class PubSubCallbackIntegrationTests : IDisposable
1714
{
1815
private readonly List<BaseClient> _testClients = [];
19-
private readonly ConcurrentBag<Exception> _callbackExceptions = [];
20-
private readonly ConcurrentBag<PubSubMessage> _receivedMessages = [];
2116
private readonly ManualResetEventSlim _messageReceivedEvent = new(false);
2217
private readonly object _lockObject = new();
2318

@@ -478,7 +473,7 @@ public async Task ErrorIsolation_WithMessageHandlerExceptions_DoesNotCrashProces
478473
Assert.True(callbackCount >= 3, "All callbacks should have been invoked despite exceptions");
479474

480475
// Process should still be running (not crashed)
481-
Assert.True(!Environment.HasShutdownStarted, "Process should not have initiated shutdown");
476+
Assert.False(Environment.HasShutdownStarted, "Process should not have initiated shutdown");
482477
}
483478

484479
[Fact]

0 commit comments

Comments
 (0)