Skip to content

Conversation

@ganchoradkov
Copy link
Member

@ganchoradkov ganchoradkov commented Oct 24, 2025

Description

This PR refactors error logging to use warning-level logging instead across multiple packages in the WalletConnect codebase. The changes downgrade logger.error() calls to logger.warn() in error handling blocks, primarily in catch clauses where errors are being logged before re-throwing or in scenarios where errors are non-fatal.

Key Changes:

  • Systematic replacement of logger.error() with logger.warn() in error handling contexts
  • Changes affect production code across sign-client, core, and provider packages
  • No changes to error handling logic, only the severity level of logged messages

The change is made as error logs are generally non actionable but polute services like sentry

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Draft PR (breaking/non-breaking change which needs more work for having a proper functionality [Mark this PR as ready to review only when completely ready])
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

n/a

Checklist

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Information (Optional)

Please include any additional information that may be useful for the reviewer.


Note

Downgrades numerous logger.error calls to logger.warn across core, sign-client, and providers to reduce log severity for recoverable paths.

  • Logging level changes (error → warn)
    • Core/controllers: crypto, expirer, history, messages, pairing, publisher, relayer, store, subscriber, verify, core – downgrade error logs for decode/restore/subscribe/publish/reconnect and validation failures.
    • Sign Client: client and controllers/engine – warn on engine method failures, request/response handling, session events, and processing queues.
    • Providers:
      • ethereum-provider/EthereumProvider – warn on connect/auth/modal/init/persisted-session handling.
      • universal-provider/UniversalProvider – warn when retrieving non-existent sessions during init.

Written by Cursor Bugbot for commit 3633098. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings October 24, 2025 07:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors error logging to use warning-level logging instead across multiple packages in the WalletConnect codebase. The changes downgrade logger.error() calls to logger.warn() in error handling blocks, primarily in catch clauses where errors are being logged before re-throwing or in scenarios where errors are non-fatal.

Key Changes:

  • Systematic replacement of logger.error() with logger.warn() in error handling contexts
  • Changes affect production code across sign-client, core, and provider packages
  • No changes to error handling logic, only the severity level of logged messages

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
providers/universal-provider/src/UniversalProvider.ts Changed session retrieval error logging from error to warn level
providers/ethereum-provider/src/EthereumProvider.ts Updated error logging to warn level in connection, request handling, and modal initialization error paths
packages/sign-client/src/controllers/engine.ts Converted numerous error logs to warnings across various RPC operations and session management flows
packages/sign-client/src/client.ts Changed error message logging to warn level in all SignClient public method wrappers
packages/core/src/core.ts Updated initialization failure logging from error to warn level
packages/core/src/controllers/verify.ts Changed attestation validation error logging to warn level
packages/core/src/controllers/subscriber.ts Updated subscription operation error logging to warn level
packages/core/src/controllers/store.ts Changed store operation error logging to warn level
packages/core/src/controllers/relayer.ts Updated transport error logging to warn level
packages/core/src/controllers/publisher.ts Changed publish failure logging to warn level
packages/core/src/controllers/pairing.ts Updated pairing operation error logging to warn level
packages/core/src/controllers/messages.ts Changed message restoration error logging to warn level
packages/core/src/controllers/history.ts Updated history restoration error logging to warn level
packages/core/src/controllers/expirer.ts Changed expiration restoration error logging to warn level
packages/core/src/controllers/crypto.ts Updated decoding error logging to warn level

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@arein arein requested a review from jakubuid October 24, 2025 09:06
Copy link
Member

@arein arein left a comment

Choose a reason for hiding this comment

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

Some of these

// Ignore if the implementing client has registered this method as known.
if (this.registeredMethods.includes(method)) return;
this.logger.error(getSdkError("WC_METHOD_UNSUPPORTED", method));
this.logger.warn(getSdkError("WC_METHOD_UNSUPPORTED", method));
Copy link
Member

Choose a reason for hiding this comment

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

sure this shouldn't remain error level?

} catch (e) {
this.logger.debug(`Failed to Publish Payload`);
this.logger.error(e as any);
this.logger.warn(e as any);
Copy link
Member

Choose a reason for hiding this comment

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

this should remain error if I understand correctly

return payload;
} catch (error) {
this.logger.error(
this.logger.warn(

Choose a reason for hiding this comment

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

Shouldn't we keep error level when we catch the error?

Copy link

@jakubuid jakubuid left a comment

Choose a reason for hiding this comment

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

Maybe we should keep error level when catching an error in try and catch blocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants