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

fix: aurora QR code x wallet config path #1570

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

shanimal08
Copy link
Collaborator

@shanimal08 shanimal08 commented Feb 25, 2025

Description

  • per Brian's comment on the ticket the default path for CredentialManager didn't match up to the initial one when creating a new wallet (matched up to use parent)

Motivation and Context

How Has This Been Tested?

  • locally, reset and removed all .alpha files, restarted and denied keychain access:

    waiting for header sync again for the video video is ginormous because it includes the sync process (wanted to show denying keychain access right in the beginning) don't think i'll get it under 10mb :(

Summary by CodeRabbit

  • Refactor
    • Enhanced the wallet configuration process with improved error handling for passphrase retrieval, contributing to increased reliability and a smoother wallet setup experience.

@shanimal08 shanimal08 changed the title fix: aurora QR code x wallet config path fix: aurora QR code x wallet config path Feb 25, 2025
@shanimal08 shanimal08 marked this pull request as ready for review February 25, 2025 15:40
@shanimal08 shanimal08 requested a review from brianp February 25, 2025 15:40
Copy link

coderabbitai bot commented Feb 25, 2025

📝 Walkthrough

Walkthrough

The pull request updates the wallet's passphrase retrieval logic. Instead of using the configuration path directly, it now retrieves the parent directory and initializes the CredentialManager with it. An error handling mechanism has been added to check if the parent directory exists, returning an error if it does not. There are no changes to any public entity declarations.

Changes

File Summary of Changes
src-tauri/src/internal_wallet.rs - Retrieves the parent directory of config_path and checks for its existence.
- Initializes CredentialManager with the parent directory.
- Adds error handling for missing parent directory.

Sequence Diagram(s)

sequenceDiagram
    participant IW as InternalWallet
    participant FS as FileSystem
    participant CM as CredentialManager

    IW->>FS: Retrieve parent directory of config_path
    FS-->>IW: Return parent directory or error
    alt Parent directory exists
        IW->>CM: Initialize with parent directory
        CM-->>IW: Provide passphrase
    else Parent directory missing
        IW-->>IW: Return error
    end
Loading

Suggested reviewers

  • brianp

Poem

In a burrow of code, I hop along,
Seeking a parent path to keep things strong.
With error checks in place, bugs hide away,
The CredentialManager shines in the light of day.
A joyous skip in the realm of code I convey! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a08824 and df0b692.

📒 Files selected for processing (1)
  • src-tauri/src/internal_wallet.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Check i18n
  • GitHub Check: tauri-build
  • GitHub Check: cargo checks (fmt, clippy, check)
🔇 Additional comments (2)
src-tauri/src/internal_wallet.rs (2)

143-146: Good addition of parent path retrieval with proper error handling.

The code now correctly retrieves the parent directory of the wallet config path with appropriate error handling, which aligns with the PR's objective to fix the mismatch between the default CredentialManager path and the wallet configuration path.


147-147: Properly fixed credential path inconsistency.

Changing to use path_parent instead of path ensures that the CredentialManager is initialized with the correct directory structure. This is consistent with how the path is handled in the decrypt_seed_words method (lines 285-292) and fixes the inconsistency that was causing the wallet configuration issue.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @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.

Copy link
Collaborator

@brianp brianp left a comment

Choose a reason for hiding this comment

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

Tested on MacOS and the sync to phone feature is fixed.

@brianp brianp merged commit e2fa40d into tari-project:main Feb 26, 2025
12 checks passed
@shanimal08 shanimal08 deleted the fix/keychain_qr branch February 26, 2025 09:01
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.

0.9.809: MacOS Sync with Phone QR code fails to generate
2 participants