Skip to content

Comments

Release: v2.4.3#631

Merged
kvhnuke merged 5 commits intomainfrom
develop
Mar 11, 2025
Merged

Release: v2.4.3#631
kvhnuke merged 5 commits intomainfrom
develop

Conversation

@kvhnuke
Copy link
Contributor

@kvhnuke kvhnuke commented Mar 11, 2025

Summary by CodeRabbit

  • Chores

    • Updated the extension version from 2.4.2 to 2.4.3.
  • New Features

    • Enhanced account access on multiple blockchain networks with improved asynchronous checks, smoother onboarding, and throttling to prevent rapid repeated triggers.
    • Migrated Ethereum network endpoints from WebSocket to secure HTTP connections for more stable communication.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2025

Walkthrough

This pull request updates the extension package version in the package.json and introduces asynchronous modifications to several blockchain account request methods. The methods in the Bitcoin, Kadena, Polkadot, and Solana providers are modified to use async functions that check for KeyRing initialization before processing account access. When not initialized, an error is returned and a throttled onboarding function is triggered. In addition, the Ethereum network configuration files have been updated by replacing WebSocket URLs with HTTPS endpoints.

Changes

File(s) Change Summary
packages/extension/package.json Updated package version from 2.4.2 to 2.4.3.
packages/extension/.../methods/[btc_requestAccounts.ts, kda_requestAccounts.ts, dot_accounts_get.ts, sol_connect.ts] Changed method signatures to asynchronous; added an asynchronous initialization check using KeyRing; introduced throttled calls to openOnboard for error handling and managing pending promises.
packages/extension/.../networks/[aa.ts, aat.ts] Replaced WebSocket URLs (wss://...) with HTTPS URLs (https://...) in the Ethereum network configuration objects.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant M as Method
    participant K as KeyRing
    participant O as OpenOnboard

    C->>M: Request account access
    M->>K: Check initialization (async)
    alt Not Initialized
        M-->>C: Return "Enkrypt not initialized" error
        M->>O: Call throttled openOnboard()
        M->>M: Handle pending promises
    else Initialized
        M->>C: Process account access
    end
Loading

Possibly related PRs

  • devop: set correct version #600: Updates the extension package version from 2.0.3 to 2.1.0, relating to similar version increment changes.
  • Release: v2.0.2 #591: Modifies the package version from 2.0.1 to 2.0.2 in the package.json, aligning with the version update theme.

Suggested reviewers

  • NickKelly1
  • gamalielhere
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Mar 11, 2025

💼 Build Files
chrome: enkrypt-chrome-048f6f59.zip
firefox: enkrypt-firefox-048f6f59.zip

💉 Virus total analysis
chrome: 048f6f59
firefox: 048f6f59

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/extension/src/providers/solana/methods/sol_connect.ts (1)

11-11: Confirm throttle behavior.
By default, lodash’s throttle triggers on the leading edge. Verify if you also need to invoke the function at the trailing edge for a smoother user experience.

packages/extension/src/providers/bitcoin/methods/btc_requestAccounts.ts (1)

11-11: Check throttle configuration.
Confirm if the default leading-edge behavior meets your needs. Consider enabling the trailing-edge option if you want to ensure the call is fired after the cooldown.

packages/extension/src/providers/kadena/methods/kda_requestAccounts.ts (1)

20-20: Throttle interval check.
The 10-second interval may be sufficient for limiting repeated calls. Keep an eye on user feedback to fine-tune timing.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e603c7 and ccd9085.

📒 Files selected for processing (7)
  • packages/extension/package.json (1 hunks)
  • packages/extension/src/providers/bitcoin/methods/btc_requestAccounts.ts (3 hunks)
  • packages/extension/src/providers/ethereum/networks/aa.ts (1 hunks)
  • packages/extension/src/providers/ethereum/networks/aat.ts (1 hunks)
  • packages/extension/src/providers/kadena/methods/kda_requestAccounts.ts (2 hunks)
  • packages/extension/src/providers/polkadot/methods/dot_accounts_get.ts (2 hunks)
  • packages/extension/src/providers/solana/methods/sol_connect.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: buildAll
  • GitHub Check: test
🔇 Additional comments (20)
packages/extension/src/providers/ethereum/networks/aat.ts (1)

17-17: Protocol change from WebSocket to HTTP

The network endpoint has been updated from WebSocket to HTTP protocol. This change aligns with modern practices as HTTP endpoints typically offer better reliability, firewall compatibility, and are more commonly used in wallet providers.

packages/extension/package.json (1)

3-3: Version bump to 2.4.3

Version has been updated from 2.4.2 to 2.4.3, which aligns with the PR title "Release: v2.4.3". This minor version increment appropriately reflects the non-breaking changes in this release.

packages/extension/src/providers/ethereum/networks/aa.ts (1)

17-17: Protocol change from WebSocket to HTTP

The network endpoint has been updated from WebSocket to HTTP protocol, consistent with the change made to the test network. This standardization improves maintenance and provides more reliable connectivity.

packages/extension/src/providers/polkadot/methods/dot_accounts_get.ts (5)

12-13: New imports for onboarding functionality

Added imports for the onboarding utility and throttle functionality, which support the enhanced error handling introduced in this update.


16-16: Throttled onboarding implementation

Good implementation of throttling the onboarding function to prevent multiple calls within a short timeframe (10 seconds), which improves user experience.


21-26: Method signature changed to async

The function has been properly updated to use async/await pattern, which is necessary for the new initialization check.


29-30: KeyRing initialization check

Added important initialization check that will help prevent errors when attempting to access accounts before the extension is fully initialized.


67-71: Enhanced error handling for uninitialized state

This new conditional block properly handles the case when KeyRing is not initialized by:

  1. Returning an appropriate error message
  2. Triggering the throttled onboarding process
  3. Continuing to process any remaining promises

This significantly improves user experience by guiding users through the onboarding flow when needed.

packages/extension/src/providers/solana/methods/sol_connect.ts (4)

6-7: Import statements look correct.
These new imports for openOnboard and throttle are valid additions for introducing a throttled onboarding flow.


16-21: Async method signature is well-defined.
Switching to async allows returning a Promise<void> and utilizing await for asynchronous checks. Overall, this improves error handling flow.


32-32: Consider handling potential exceptions.
If this.KeyRing.isInitialized() rejects due to unexpected errors, it might leave the state in an undeclared status. You may consider wrapping the call in a try/catch block to manage any thrown exceptions gracefully.


46-50: Immediate return upon non-initialized state is appropriate.
Ending further processing helps prevent invalid states. Throttling openOnboard ensures the onboarding pop-up is not triggered repeatedly.

packages/extension/src/providers/bitcoin/methods/btc_requestAccounts.ts (4)

7-8: Imports are suitably added.
The openOnboard function and throttle from lodash are introduced to manage repeated onboarding prompts effectively.


16-21: Async method usage is correct.
Converting to an async function aligns well with the new onboarding logic. Good job synchronizing the interface return type with the actual asynchronous flow.


32-32: Evaluate exception handling for KeyRing.
If isInitialized() throws an error, it may skip the flow entirely. Adding a try/catch guard could help avoid pending state issues.


46-50: Early exit for initialization failure is sensible.
Properly returning here avoids further invalid account access attempts and triggers the throttled onboarding process.

packages/extension/src/providers/kadena/methods/kda_requestAccounts.ts (4)

16-17: New imports verified.
openOnboard and throttle from lodash are introduced consistently with other provider methods in this PR.


27-32: Async method signature.
Upgrading to async improves clarity for the returned Promise<void>. This follows best practices for asynchronous flows.


35-35: Consider potential runtime errors.
Tie isInitialized into a higher-level error handling strategy to recover seamlessly if this.KeyRing.isInitialized() encounters connectivity or unexpected errors.


102-106: Proper early termination when uninitialized.
Short-circuiting further account handling is a solid approach. Triggering the throttled onboarding here matches the revised flow in other providers.

@kvhnuke kvhnuke merged commit 88b1888 into main Mar 11, 2025
3 of 4 checks passed
@Iambarry1
Copy link

Summary by CodeRabbit

  • Chores

    • Updated the extension version from 2.4.2 to 2.4.3.
  • New Features

    • Enhanced account access on multiple blockchain networks with improved asynchronous checks, smoother onboarding, and throttling to prevent rapid repeated triggers.
    • Migrated Ethereum network endpoints from WebSocket to secure HTTP connections for more stable communication.

1 similar comment
@Iambarry1
Copy link

Summary by CodeRabbit

  • Chores

    • Updated the extension version from 2.4.2 to 2.4.3.
  • New Features

    • Enhanced account access on multiple blockchain networks with improved asynchronous checks, smoother onboarding, and throttling to prevent rapid repeated triggers.
    • Migrated Ethereum network endpoints from WebSocket to secure HTTP connections for more stable communication.

@coderabbitai coderabbitai bot mentioned this pull request Apr 14, 2025
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