Skip to content
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

fix: Misdefined types related to Bridge{,Status}Controller state #29443

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

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Jan 6, 2025

Description

  • The first commit (65d78c9) fixes errors in the messenger types for Bridge{,Status}Controller.
  • The second commit (b8765f9) is optional, but strongly recommended. Under the BaseController API with which the Bridge{,Status}Controller are defined, BridgeControllerState and BridgeStatusControllerState should be considered to be reserved keywords.
    • The current set of types violates guidelines: https://github.com/MetaMask/core/blob/main/docs/writing-controllers.md#define-and-export-a-type-for-the-controllers-state.
    • Deviating from this convention breeds confusion and silently-failing errors as per the examples fixed in the first commit.
    • This also affects downstream consumers and dependent modules of the bridge controllers, as the expected functionality for the reserved keywords is not fulfilled.
    • The type expressions { bridgeState: BridgeControllerState }, { bridgeStatusState: BridgeStatusControllerState } are being used redundantly and should be de-duplicated. However, defining these types using anything other than the reserved keywords will cause further unnecessary confusion.

Open in GitHub Codespaces

Related issues

Manual testing steps

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.

@MajorLift MajorLift self-assigned this Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 6, 2025

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.

@MajorLift MajorLift changed the title Fix misdefined types related to Bridge{,Status}Controller state fix: Misdefined types related to Bridge{,Status}Controller state Jan 6, 2025
@MajorLift MajorLift marked this pull request as ready for review January 6, 2025 19:16
@MajorLift MajorLift requested a review from a team as a code owner January 6, 2025 19:16
@metamaskbot
Copy link
Collaborator

Builds ready [b8765f9]
Page Load Metrics (1700 ± 49 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1463191516989847
domContentLoaded14121903167010550
load14541917170010349
domInteractive25230736330
backgroundConnect96125157
firstReactRender1683362411
getState559232110
initialActions01000
loadScripts1044145412548641
setupStore65510105
uiStartup16912106191711957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

2 participants