-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(local-storage): enhance local storage availability checks FE-1221 #132
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nelitow
changed the title
feat(local-storage): enhance local storage availability checks
feat(local-storage): enhance local storage availability checks FE-1221
Dec 22, 2024
Coverage report
Test suite run success23 tests passing in 3 suites. Report generated by 🧪jest coverage report action from 90588e1 |
…noid and cross-spawn
…ore, and update tests for new local-storage checks
…origin/main'" This reverts commit 672eaec.
…anch and configure upstream tracking for the main branch.
…anch and set the pull request reference. Removed unused PR number and skip-test parameters for cleaner configuration.
…eamline branch fetching. Added steps to set global user details and ensure the main branch is checked out before the pull request branch, enhancing the workflow's reliability.
…with Changesets action for improved changeset checking. This enhances the workflow's reliability and simplifies the configuration.
LuizAsFight
approved these changes
Dec 25, 2024
nelitow
pushed a commit
that referenced
this pull request
Dec 25, 2024
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @fuels/local-storage@0.26.0 ### Minor Changes - Check for localStorage availability, by [@nelitow](https://github.com/nelitow) (See [#132](#132)) ## @fuels/react-xstore@0.26.0 ### Minor Changes - Update tests to handle the new local-storage checks, by [@nelitow](https://github.com/nelitow) (See [#132](#132)) ## @fuels/changeset@0.26.0 ## @fuels/eslint-plugin@0.26.0 ## @fuels/jest@0.26.0 ## @fuels/kms-account@0.26.0 ## @fuels/prettier-config@0.26.0 ## @fuels/proxy-cli@0.26.0 ## @fuels/ts-config@0.26.0 ## @fuels/tsup-config@0.26.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the
local-storage
package with some safety checking and the testshould persist todos state on local storage
inReactFactory.test.tsx
to account for new defensive programming features added to the local-storage package.Also fixes AUDIT packages.
Changes
Local Storage Package Updates
Added
checkLocalStorageAvailability
method to safely verify localStorage access:Added try-catch blocks around all localStorage operations to handle potential failures:
setItem
: Handles quota exceeded errorsgetItem
: Handles parsing errorsremoveItem
: Handles removal failuresclear
: Handles bulk operation failuresTest Updates
Why
The local-storage package was enhanced with defensive programming features to handle various edge cases:
These safety checks caused the original test to fail because:
localStorage.setItem
setItem
The updated test now:
__storage_test__
)Testing