fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2 cp-7.67.3#26979
Conversation
…rows correctly if no callbacks specified
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
redux-persist-filesystem-storage returns a promise and throws correctlyredux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2
mikesposito
left a comment
There was a problem hiding this comment.
Patch changes look good to me
|
The committed fixture schema is out of date. To update, comment: |
| - .then(() => callback && callback()) | ||
| - .catch(error => callback && callback(error)), | ||
| + .then(() => { | ||
| + if (isIOS) ReactNativeBlobUtil.ios.excludeFromBackupKey(pathForKey(key)); |
There was a problem hiding this comment.
This branch also causes a dangling promise, but I am unsure how to deal with that. We likely do not want to wait for this before returning.
redux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2redux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2 cp-7.67.3
|
Missing release label release-7.68.0 on PR. Adding release label release-7.68.0 on PR and removing other release labels(release-7.69.0), as PR was cherry-picked in branch 7.68.0. |



Description
This PR adjusts our existing patch for
redux-persist-filesystem-storageto always return a promise forsetItemso it can be awaited correctly, fixing potential race conditions. This was broken when the patch originally was created by adding brackets to an arrow function and not returning. The PR also fixes a bug where not passing in a callback would cause errors to be swallowed. Additionally, this PR moves our existing patch to use the built-in Yarn patch feature (because creating new patches withpatch-packageseems broken).Changelog
CHANGELOG entry: Improve reliability of persistence
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches persistence write behavior by changing the patched
redux-persist-filesystem-storagesetItemcontrol flow and error propagation, which could affect app startup/migrations if any callers depend on the old callback-only semantics. Also introduces an iOS-only side effect (exclude-from-backup) after writes.Overview
This PR updates the Yarn patch for
redux-persist-filesystem-storagesosetItemalways returns a Promise that can be awaited, rather than potentially relying on callback chaining.It also fixes error handling so write failures are thrown when no callback is provided (instead of being swallowed), and adds an optional
isIOSflag to runReactNativeBlobUtil.ios.excludeFromBackupKey(...)after successful writes on iOS.Dependency wiring is switched from a normal semver dependency to Yarn’s built-in
patch:reference forredux-persist-filesystem-storage@4.2.0, with correspondingyarn.lockupdates.Written by Cursor Bugbot for commit 192a5c8. This will update automatically on new commits. Configure here.