Skip to content

chore(runway): cherry-pick fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly (#26979)#27080

Merged
joaoloureirop merged 1 commit intorelease/7.68.0from
runway-cherry-pick-7.68.0-1772736109
Mar 5, 2026
Merged

chore(runway): cherry-pick fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly (#26979)#27080
joaoloureirop merged 1 commit intorelease/7.68.0from
runway-cherry-pick-7.68.0-1772736109

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Mar 5, 2026

Description

This PR adjusts our existing patch for
redux-persist-filesystem-storage to always return a promise for
setItem so 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 with
patch-package seems broken).

Changelog

CHANGELOG entry: Improve reliability of persistence

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Medium Risk
Touches persistence write behavior by changing the patched
redux-persist-filesystem-storage setItem control 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-storage
so setItem always 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 isIOS flag to run
ReactNativeBlobUtil.ios.excludeFromBackupKey(...) after successful
writes on iOS.

Dependency wiring is switched from a normal semver dependency to
Yarn’s built-in patch: reference for
redux-persist-filesystem-storage@4.2.0, with corresponding yarn.lock
updates.

Written by Cursor
Bugbot
for commit
192a5c8. This will update automatically
on new commits. Configure
here.

[02ac109](https://github.com/MetaMask/metamask-mobile/commit/02ac109fb36974ecfe3dbbdecc15b529bc2a8d17)

…age` returns a promise and throws correctly cp-7.67.2 (#26979)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR adjusts our existing patch for
`redux-persist-filesystem-storage` to always return a promise for
`setItem` so 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 with
`patch-package` seems broken).

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Improve reliability of persistence

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches persistence write behavior by changing the patched
`redux-persist-filesystem-storage` `setItem` control 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-storage`
so `setItem` **always 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 `isIOS` flag to run
`ReactNativeBlobUtil.ios.excludeFromBackupKey(...)` after successful
writes on iOS.
> 
> Dependency wiring is switched from a normal semver dependency to
Yarn’s built-in `patch:` reference for
`redux-persist-filesystem-storage@4.2.0`, with corresponding `yarn.lock`
updates.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
192a5c8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github bot requested a review from a team as a code owner March 5, 2026 18:41
@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.68.0)

All E2E tests pre-selected.

View GitHub Actions results

@github-actions github-actions bot added the size-S label Mar 5, 2026
@joaoloureirop joaoloureirop changed the title chore(runway): cherry-pick 02ac109 chore(runway): cherry-pick fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2 cp-7.67.3 (#26979) Mar 5, 2026
@joaoloureirop joaoloureirop changed the title chore(runway): cherry-pick fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly cp-7.67.2 cp-7.67.3 (#26979) chore(runway): cherry-pick fix: Ensure redux-persist-filesystem-storage returns a promise and throws correctly (#26979) Mar 5, 2026
@joaoloureirop joaoloureirop enabled auto-merge (squash) March 5, 2026 19:17
@joaoloureirop joaoloureirop merged commit fce0e5c into release/7.68.0 Mar 5, 2026
194 of 197 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.68.0-1772736109 branch March 5, 2026 20:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-S team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants