feat: add new ConnectivityController#7623
Merged
cryptodev-2s merged 7 commits intomainfrom Jan 15, 2026
Merged
Conversation
b14162d to
daa5333
Compare
daa5333 to
5e51275
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
7 tasks
mcmire
reviewed
Jan 14, 2026
mcmire
reviewed
Jan 14, 2026
…CTIVITY_STATUSES - Rename ConnectivityStatus constant to CONNECTIVITY_STATUSES - Export ConnectivityStatus as a type instead of enum - Update all references to use CONNECTIVITY_STATUSES - Export CONNECTIVITY_STATUSES from index
mcmire
reviewed
Jan 14, 2026
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
mcmire
reviewed
Jan 14, 2026
Contributor
mcmire
left a comment
There was a problem hiding this comment.
Last round of feedback, I think. Everything else looks good beyond this.
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
packages/connectivity-controller/src/ConnectivityController.test.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
This PR introduces a new
@metamask/connectivity-controllerpackage that provides a centralized way to track and manage device internet connectivity status across MetaMask clients (extension and mobile).What is the current state of things and why does it need to change?
What is the solution your changes offer and how does it work?
The
ConnectivityControlleris a platform-agnostic controller that:onlineoroffline) in its stateConnectivityServiceimplementations are injected at construction timestateChangeevents when connectivity status changes, allowing other controllers and UI components to react accordinglyThe controller is designed to work with different service implementations:
NetInfoConnectivityServiceusing@react-native-community/netinfoBrowserConnectivityServiceusing browser APIsAre there any changes whose purpose might not be obvious to those unfamiliar with the domain?
connectivityStatusfield in state is prefixed with "connectivity" to avoid conflicts when state is flattened in Reduxpersist: falsesince connectivity status is ephemeral and should not be restored from storageReferences
Fixes: https://consensyssoftware.atlassian.net/browse/WPC-210
Checklist
Note
Introduce a new, platform-agnostic controller to track device connectivity with adapter-driven status updates.
@metamask/connectivity-controllerexposingConnectivityController,CONNECTIVITY_STATUSES, andConnectivityAdapterinterfacegetStatus()and updates state ononConnectivityChange, with non-persistentconnectivityStatusmetadataCODEOWNERS,teams.json, tsconfig references, andyarn.lockentryWritten by Cursor Bugbot for commit 16c51b5. This will update automatically on new commits. Configure here.