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

Update storage.ts #2878

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update storage.ts #2878

wants to merge 3 commits into from

Conversation

rsoaresdev
Copy link

Please verify the following:

  • yarn test jest tests pass with new tests, if relevant
  • yarn lint eslint checks pass with new code, if relevant
  • yarn format:check prettier checks pass with new code, if relevant
  • README.md (or relevant documentation) has been updated with your changes
  • If this affects functionality there aren't tests for, I manually tested it, including by generating a new app locally if needed (see docs).

Describe your PR

This PR addresses potential issues with the loadString function in our storage module. Previously, the function might have failed silently or returned unexpected results when the key was not found in storage. The following changes have been made:
• Added an explicit check for undefined to ensure we return null if the key is not found.
• Included error handling with a console.error log in case of unexpected failures while reading from storage.

Why this change?:

This change improves the reliability of the loadString function and helps to debug any issues with data fetching from storage. It also prevents returning undefined when the key is not found, providing more predictable behavior.

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