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

feat: add custom form check alerts #25259

Merged
merged 31 commits into from
Jul 17, 2024
Merged

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Jun 12, 2024

Description

This PR complete the add custom network Flow

Chain Name and ChainID Match: The system should validate that the chain name provided by the user matches the corresponding network chainId. This can be done by comparing the input against a predefined list of known chain names and their associated chainIds.

Valid rpcURL: The rpcURL provided should be verified against a list of known providers. This ensures that the rpcURL is not only valid but also corresponds to a trusted source.

Unique rpcURL: The system must ensure that the rpcURL provided is not already associated with another added network within the system. This can be achieved by checking the new rpcURL against a database or list of rpcURLs already associated with existing networks.

Unique ChainID and rpcURL Combination: The combination of chainID and rpcURL should be unique and not duplicated in another existing network within the system. This requires a check against existing combinations to ensure no duplicates are allowed.

Suggest Correct Network Name and Symbol: If the network name or symbol provided does not match the expected values (based on the chainId or other validation logic), the system should suggest the correct network name and symbol. This could involve providing a dropdown list of valid names/symbols based on the chainId or implementing a correction suggestion mechanism.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Run yarn && ENABLE_NETWORK_UI_REDESIGN=1 yarn start
  2. Go to Settings -> Developer Options
  3. Tun on the network new toggle
  4. Go to the wallet page
  5. Click on the network button ( see the video below )
  6. click on add/edit network a check the acceptance criteria above

Screenshots/Recordings

Before

After

Screenshot 2024-06-24 at 23 19 30
Screenshot 2024-06-24 at 23 19 42

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.

@salimtb salimtb added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 12, 2024
@salimtb salimtb requested a review from a team as a code owner June 12, 2024 15:10
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.

@salimtb salimtb changed the base branch from develop to add-custom-network-modal-form June 12, 2024 15:10
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 12, 2024
@salimtb salimtb force-pushed the add-custom-form-check-alerts branch from 924e14f to 7b15964 Compare June 12, 2024 16:09
@salimtb salimtb force-pushed the add-custom-network-modal-form branch 7 times, most recently from 2cb64d3 to 2db5534 Compare June 18, 2024 14:58
Base automatically changed from add-custom-network-modal-form to develop June 18, 2024 21:09
@salimtb salimtb force-pushed the add-custom-form-check-alerts branch from 7b15964 to 38c38f2 Compare June 24, 2024 18:08
@salimtb salimtb changed the title Add custom form check alerts feat: add custom form check alerts Jun 24, 2024
@salimtb salimtb force-pushed the add-custom-form-check-alerts branch 2 times, most recently from 134e0c4 to e16566f Compare June 24, 2024 20:41
@salimtb salimtb added team-assets needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Jun 24, 2024
@salimtb salimtb force-pushed the add-custom-form-check-alerts branch 4 times, most recently from 97342b5 to bf9d5bf Compare June 24, 2024 21:58
@salimtb salimtb force-pushed the add-custom-form-check-alerts branch 2 times, most recently from 54955c7 to 1e8133e Compare June 25, 2024 13:25
@sahar-fehri

This comment was marked as resolved.

@sahar-fehri

This comment was marked as resolved.

@metamaskbot
Copy link
Collaborator

Builds ready [ca484d4]
Page Load Metrics (211 ± 210 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6712498168
domContentLoaded105828136
load441577211437210
domInteractive105828136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.14 KiB (0.06%)
  • common: 924 Bytes (0.01%)

ui/store/actions.ts Outdated Show resolved Hide resolved
@bergeron

This comment was marked as resolved.

@salimtb
Copy link
Contributor Author

salimtb commented Jul 16, 2024

According to our records, this URL does not match a known provider for this chain ID.

@sahar-fehri the error you're mentionning refer to an invalid rpc URL ( which mean the URL is not a node provider ).

@salimtb
Copy link
Contributor Author

salimtb commented Jul 16, 2024

This looks great! 🎉

When the input RPC url is not a url like, i kinda expected to have the following error msg to appear immediately URLs require the appropriate HTTP/HTTPS prefix. But it appears only after doing input of chainId; was this intended?

Screen.Recording.2024-07-15.at.15.37.30.mov

yes this was intentional ( we have the same behavior on develop )

@metamaskbot
Copy link
Collaborator

Builds ready [857f42b]
Page Load Metrics (162 ± 190 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint632861115627
domContentLoaded98228189
load401883162396190
domInteractive98228189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.14 KiB (0.06%)
  • common: 924 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [516a62e]
Page Load Metrics (237 ± 238 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint76140107189
domContentLoaded9402094
load441744237495238
domInteractive9402094
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.14 KiB (0.06%)
  • common: 784 Bytes (0.01%)

EtherWizard33

This comment was marked as resolved.

@metamaskbot
Copy link
Collaborator

Builds ready [7c6a436]
Page Load Metrics (151 ± 145 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint592051123015
domContentLoaded96131157
load421460151301145
domInteractive96131157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.14 KiB (0.06%)
  • common: 784 Bytes (0.01%)

bergeron
bergeron previously approved these changes Jul 16, 2024
Copy link

sonarcloud bot commented Jul 17, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [b2f66a2]
Page Load Metrics (359 ± 329 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint653011135526
domContentLoaded96725157
load392209359686329
domInteractive96725157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.05 KiB (0.06%)
  • common: 784 Bytes (0.01%)

@salimtb salimtb merged commit 2585dcf into develop Jul 17, 2024
79 checks passed
@salimtb salimtb deleted the add-custom-form-check-alerts branch July 17, 2024 16:28
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants