Skip to content

feat: Throttle state serialization #15266

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tommasini
Copy link
Contributor

The storage write debounce has been replaced with the redux-persist option throttle. This option has the advantage of applying to state serialization as well as writing, so we avoid frequent expensive serialization. Using throttle instead of debounce also guarantees a write every so often during periods of rapid state updates, ensuring the application doesn't go too long without persisting.

Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

The storage write debounce has been replaced with the `redux-persist`
option `throttle`. This option has the advantage of applying to state
serialization as well as writing, so we avoid frequent expensive
serialization. Using `throttle` instead of `debounce` also guarantees
a write every so often during periods of rapid state updates, ensuring
the application doesn't go too long without persisting.
@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label May 9, 2025
@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Requires smoke E2E testing labels May 9, 2025
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue May 9, 2025
Copy link
Contributor

github-actions bot commented May 9, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: aca8b07
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b5e98b8d-28bd-4302-a04d-0110adc096af

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Cal-L
Cal-L previously approved these changes May 9, 2025
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Platform code LGTM, agreed with @Prithpal-Sooriya . let's rename it to be throttle

@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue May 9, 2025
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@tommasini tommasini added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 98d9694
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cb191897-37e4-4829-9d64-c20a16ac51f5

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tommasini tommasini added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 43f102f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/baa92418-b633-4167-a58d-6578ddf9f8fa

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@tommasini tommasini added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 53862c4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a2268231-5889-49a3-ad65-48137d4ff8fb

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Requires smoke E2E testing team-mobile-platform Mobile Platform team
Projects
Status: Review finalised - Ready to be merged
Development

Successfully merging this pull request may close these issues.

5 participants