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

Merged
merged 7 commits into from
May 14, 2025
Merged

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

@tommasini tommasini removed the Run Smoke E2E Requires smoke E2E testing label May 14, 2025
@tommasini tommasini added the Run Smoke E2E Requires smoke E2E testing label May 14, 2025
Copy link
Contributor

github-actions bot commented May 14, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 5531a6f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6f280a36-937f-4761-b709-69d51b9647ed

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 14, 2025
@tommasini tommasini added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
Copy link
Contributor

github-actions bot commented May 14, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 70f917c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4916ae33-ad9a-4d66-bd41-7c919b9c6788

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

Copy link

@tommasini tommasini added this pull request to the merge queue May 14, 2025
Merged via the queue into main with commit f59f08b May 14, 2025
45 of 51 checks passed
@tommasini tommasini deleted the throttle-state-serialization branch May 14, 2025 15:51
@github-project-automation github-project-automation bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue May 14, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2025
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label May 14, 2025
@metamaskbot metamaskbot added the release-7.48.0 Issue or pull request that will be included in release 7.48.0 label May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.48.0 Issue or pull request that will be included in release 7.48.0 Run Smoke E2E Requires smoke E2E testing team-mobile-platform Mobile Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants