Skip to content

fix: invalidate key_pair cache instead of setting directly#489

Open
21pages wants to merge 1 commit intorustdesk:mainfrom
21pages:fix_key_pair_set
Open

fix: invalidate key_pair cache instead of setting directly#489
21pages wants to merge 1 commit intorustdesk:mainfrom
21pages:fix_key_pair_set

Conversation

@21pages
Copy link
Contributor

@21pages 21pages commented Feb 9, 2026

fix #484

Using None instead of Some(key_pair) when updating the cache. If the incoming key_pair is empty, Some(key_pair) would cache the empty value and get_key_pair() would always return it without regenerating or loading.

Screenshot 2026-02-12 at 11 33 52

@21pages 21pages marked this pull request as draft February 9, 2026 12:40
@21pages 21pages marked this pull request as ready for review February 12, 2026 03:44
@rustdesk rustdesk requested a review from Copilot February 13, 2026 15:47
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

Fixes macOS key-pair caching behavior when updating Config, preventing an empty key_pair from being cached and blocking regeneration/loading (per #484).

Changes:

  • Drops the CONFIG write lock before touching KEY_PAIR to avoid lock-ordering issues.
  • Replaces direct KEY_PAIR cache assignment with a helper that invalidates the cache when the key pair changes (macOS only).
  • Adds inline documentation explaining why the cache is cleared (set to None) instead of caching an empty key pair.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: 21pages <sunboeasy@gmail.com>
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant