Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added debug to help figure out why this won't work in blazor wasm #642

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/PinguApps.Appwrite.Playground/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ public record Table1

public async Task Run(string[] args)
{
_realtimeClient.SetSession(_session);

using (_realtimeClient.Subscribe<Document<Table1>>("documents", x =>
{
Console.WriteLine(x.Payload);
}))
{
await Task.Delay(5000);

_realtimeClient.SetSession(_session);

Console.ReadKey();
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/PinguApps.Appwrite.Realtime/RealtimeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ private async Task ConnectAsync()
_client.DisconnectionHappened.Subscribe(info =>
{
_logger.LogWarning("WebSocket disconnected: {Type}", info.Type);

// TODO: Remove
_logger.LogWarning("CloseStatus: {CloseStatus}", info.CloseStatus);
_logger.LogWarning("CloseStatusDescription: {CloseStatusDescription}", info.CloseStatusDescription);
_logger.LogWarning("SubProtocol: {SubProtocol}", info.SubProtocol);
_logger.LogWarning("Exception: {Exception}", info.Exception);
Comment on lines +117 to +121
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary Debug Logs Left in Production Code category Functionality

Tell me more
What is the issue?

Temporary debug logging statements are marked with TODO: Remove but left in the code. This was only intended for troubleshooting.

Why this matters

Leaving temporary debug logs in production code can flood the logs with unnecessary information, making it harder to identify actual issues and potentially impacting performance.

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential exposure of sensitive exception details in log statement. category Logging

Tell me more

The log statement _logger.LogWarning("Exception: {Exception}", info.Exception); might potentially log sensitive exception details that should not be disclosed. Consider clearing this statement or converting any sensitive exception details into more generic error messages.

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.


_reconnectTrigger.OnNext(Unit.Default);
});

Expand Down Expand Up @@ -152,6 +159,9 @@ private void HandleMessage(ResponseMessage message)
return;
}

// TODO: Remove
_logger.LogInformation("Received message: {Message}", message.Text);
Comment on lines +162 to +163
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raw WebSocket Message Logging in Production category Functionality

Tell me more
What is the issue?

Another temporary debug logging statement is left in the code that logs raw WebSocket messages.

Why this matters

Logging raw WebSocket messages in production could expose sensitive information and significantly increase log volume, potentially impacting system performance and log storage costs.

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.


var response = JsonSerializer.Deserialize<RealtimeMessage>(message.Text!);

if (response is null)
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Shared/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace PinguApps.Appwrite.Shared;
public static class Constants
{
public const string Version = "2.0.0";
public const string Version = "2.0.1";
}
Loading