Skip to content

Conversation

@justlevine
Copy link
Collaborator

What

Ensures Settings::get_api_key() returns a string even if decryption fails - e.g. from a legacy key.

Why

Fixes a regression in #71 where the string coersion wasn't appl

Related Issue(s):

How

Testing Instructions

Screenshots

Additional Info

Checklist

  • I have read the Contribution Guidelines.
  • I have read the Development Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint etc.).
  • My code has detailed inline documentation.
  • I have updated the project documentation as needed.

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

Ensures Settings::get_api_key() always returns a string even when decryption fails (e.g., legacy/invalid stored keys), avoiding type errors under strict_types.

Changes:

  • Coerce the decrypted API key result to a string-safe return value in Settings::get_api_key().
  • Simplify Settings::regenerate_api_key() to return the generated key directly.

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

@justlevine justlevine merged commit 72449fe into develop Jan 27, 2026
12 of 15 checks passed
@justlevine justlevine deleted the fix/coerce-decrypt branch January 27, 2026 18:34
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.

2 participants