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

Conversation

pingu2k4
Copy link
Contributor

@pingu2k4 pingu2k4 commented Jan 23, 2025

Changes

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

Issue

Categorise the PR

  • feature
  • bug
  • docs
  • security
  • meta
  • patch
  • minor
  • major

Description by Korbit AI

What change is being made?

Add debug logging to RealtimeClient to help identify issues with WebSocket disconnections in Blazor WebAssembly and update the version in Constants from "2.0.0" to "2.0.1".

Why are these changes being made?

These changes are implemented to gather more detailed information on WebSocket disconnections by logging additional details such as CloseStatus, CloseStatusDescription, SubProtocol, Exception, and received messages, which aids in troubleshooting the issue. The version update reflects this debugging modification, helping to track the applicability of changes in this build.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@pingu2k4 pingu2k4 self-assigned this Jan 23, 2025
@github-actions github-actions bot added bug Something isn't working patch labels Jan 23, 2025
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
PinguApps.Appwrite.Client 100% 100% 141
PinguApps.Appwrite.Server 100% 100% 154
PinguApps.Appwrite.Shared 100% 100% 1424
Summary 100% (3853 / 3854) 100% (735 / 737) 1719

Copy link

Test Results

3 727 tests  ±0   3 727 ✅ ±0   55s ⏱️ +4s
    3 suites ±0       0 💤 ±0 
    3 files   ±0       0 ❌ ±0 

Results for commit bc10573. ± Comparison against base commit e2ab544.

This pull request removes 339 and adds 339 tests. Note that renamed tests count towards both.
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = 1800, SessionId = "6792c1e10025934740dc", UserId = "6792c1e100259aa8c8e8", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = null, SessionId = null, UserId = "6792c1e100256d84459b", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "6792c1e1002592bec0a2", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "6792c1e1002595477718", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "6792c1e1002597f34cc5", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "6792c1e10025993bd819", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label1", "label2"], UserId = "6792c1e10025a5c62903", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label3", "label4"], UserId = "6792c1e10025a8d671cb", ValidationContext = None })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = "", ProviderId = "provider123", TargetId = "6792c1e00015808ec4da", ValidationContext = None })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = null, ProviderId = "provider123", TargetId = "6792c1e000158728c9b9", ValidationContext = None })
…
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = 1800, SessionId = "6792d24300394ff24d0f", UserId = "6792d243003943fdc148", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = null, SessionId = null, UserId = "6792d2430038be010448", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "6792d243003943ba4932", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "6792d243003943f8768b", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "6792d2430039460e1ca9", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "6792d24300394bd5f960", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label1", "label2"], UserId = "6792d24300394abe9bf5", ValidationContext = None })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label3", "label4"], UserId = "6792d243003948b7c4c9", ValidationContext = None })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = "", ProviderId = "provider123", TargetId = "6792d24300016a14ec0d", ValidationContext = None })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = null, ProviderId = "provider123", TargetId = "6792d243000160f1eeda", ValidationContext = None })
…

@pingu2k4 pingu2k4 merged commit 9279d39 into dev Jan 23, 2025
6 of 7 checks passed
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Temporary Debug Logs Left in Production Code ▹ view
Functionality Raw WebSocket Message Logging in Production ▹ view
Logging Potential exposure of sensitive exception details in log statement. ▹ view
Files scanned
File Path Reviewed
src/PinguApps.Appwrite.Shared/Constants.cs
src/PinguApps.Appwrite.Realtime/RealtimeClient.cs

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Comment on lines +117 to +121
// 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);
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.

Comment on lines +162 to +163
// TODO: Remove
_logger.LogInformation("Received message: {Message}", message.Text);
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.

_logger.LogWarning("CloseStatus: {CloseStatus}", info.CloseStatus);
_logger.LogWarning("CloseStatusDescription: {CloseStatusDescription}", info.CloseStatusDescription);
_logger.LogWarning("SubProtocol: {SubProtocol}", info.SubProtocol);
_logger.LogWarning("Exception: {Exception}", info.Exception);
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant