MetaMask / MetaMask/metamask-mobile

Stop empty state updates from `CronjobController`

Open
#15,473 0 comments 0 reactions 0 assignees View on GitHub
area-performance INVALID-ISSUE-TEMPLATE snaps-unrefined-backlog team-core-platform
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

**What is this about?**

Findings - Using [redux-devtools-expo-dev-plugin](https://github.com/matt-oakes/redux-devtools-expo-dev-plugin), we found some areas that should be optimized.

- `CronjobController` is also triggering many state updates. None of them includes any states. The controller needs to prevent these empty state updates from triggering OR we need to unsubscribe to the controller if it isn't meant to provide state

Video showing empty states on `CronjobController` triggered updates
https://github.com/user-attachments/assets/cc6f6cfb-0e9d-498a-a3c6-f53a163f3f7b

**Technical Details**

- Prevent empty state updates from triggering on `CronjobController`
- If state is not expected of the controller, we should unsubscribe from the state updates event

**Acceptance Criteria**

- `CronjobController` should not produce empty state updates

**Stakeholder review needed before the work gets merged**

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

**References**

Original findings - https://github.com/MetaMask/metamask-mobile/issues/15028#issuecomment-2892820535

Contributor guide

Open the contributing guide

Research direction

Locate CronjobController and trace how its state updates are emitted, using the redux-devtools-expo-dev-plugin finding as context. Determine whether the controller should emit state at all, then verify that it no longer produces empty state updates and that the relevant automation tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.