Skip to content

fix: filter and subscribe when using requestQueueing#23386

Merged
adonesky1 merged 5 commits intodevelopfrom
zb/filter-and-subscribe
Mar 8, 2024
Merged

fix: filter and subscribe when using requestQueueing#23386
adonesky1 merged 5 commits intodevelopfrom
zb/filter-and-subscribe

Conversation

@BelfordZ
Copy link
Copy Markdown
Contributor

@BelfordZ BelfordZ commented Mar 7, 2024

Description

When using the per-dapp network selection feature flag, subscribe and filter requests are not respecting the per-dapp selection. This the main goal of this PR. Additionally, this PR correctly uses the persisted values for the feature flag. It also addresses an issue where changing the feature flag value would require dapps to be refreshed.

Related issues

Manual testing steps

note to test subscribe:

  1. go to https://docs.metamask.io/wallet/reference/eth_subscribe/

  2. open dev tools / console and add event listener: window.ethereum.on('message', ({data}) => console.log(parseInt(data.result.number, 16)));

  3. hit execute on eth_subscribe

  4. console should now start showing block updates

  5. Basic Functionality Tests:
    - Verify that subscribing to different Ethereum events (like block headers, logs, or specific event types) works as expected.
    - Test filtering functionalities, ensuring that the filter correctly captures and displays events based on provided criteria.

  6. Network-Specific Tests:
    - Test the subscribe and filter functionalities across different networks (mainnet, Ropsten, Kovan, etc.) to ensure consistent behavior.
    - Check for any network-specific issues or inconsistencies in the functioning of the subscribe and filter features.

  7. Test with and without useRequestQueue Feature Flag:
    - Conduct tests with the useRequestQueue feature flag enabled and verify the functioning of the subscribe and filter features.
    - Repeat the tests with the feature flag disabled to ensure that the functionalities remain stable and consistent.

  8. Repeat the above tests, but in a multi-dapp scenario

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@BelfordZ BelfordZ requested a review from a team as a code owner March 7, 2024 22:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 7, 2024

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.

@BelfordZ BelfordZ force-pushed the zb/filter-and-subscribe branch from c2944f9 to cdd83ff Compare March 7, 2024 22:49
@BelfordZ BelfordZ force-pushed the zb/filter-and-subscribe branch from cdd83ff to f57cd40 Compare March 7, 2024 23:29
@BelfordZ BelfordZ added the team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead label Mar 7, 2024
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 7, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@metamask/json-rpc-engine@7.3.2, npm/eth-json-rpc-filters@6.0.1, npm/eth-query@2.1.2

View full report↗︎

@BelfordZ BelfordZ changed the title fix filter and subscribe when using requestQueueing fix: filter and subscribe when using requestQueueing Mar 7, 2024
@BelfordZ
Copy link
Copy Markdown
Contributor Author

BelfordZ commented Mar 7, 2024

@metamaskbot update-policies

@BelfordZ BelfordZ force-pushed the zb/filter-and-subscribe branch from e711111 to 6e42940 Compare March 7, 2024 23:52
@metamaskbot
Copy link
Copy Markdown
Collaborator

Policies updated

@BelfordZ BelfordZ requested review from a team as code owners March 7, 2024 23:59
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.68%. Comparing base (320f5bf) to head (4b0d6e7).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23386      +/-   ##
===========================================
+ Coverage    68.67%   68.68%   +0.01%     
===========================================
  Files         1106     1106              
  Lines        43356    43342      -14     
  Branches     11591    11594       +3     
===========================================
- Hits         29773    29767       -6     
+ Misses       13583    13575       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [4b0d6e7]
Page Load Metrics (1266 ± 482 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint672121204120
domContentLoaded10342084
load53279112661004482
domInteractive10342084
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.94 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Code looks good! And Tested and its working nicely for me!

Copy link
Copy Markdown
Member

@jiexi jiexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shallowly tested. Looks good!

@adonesky1 adonesky1 merged commit aa9c3e3 into develop Mar 8, 2024
@adonesky1 adonesky1 deleted the zb/filter-and-subscribe branch March 8, 2024 17:26
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2024
@metamaskbot metamaskbot added the release-11.14.0 Issue or pull request that will be included in release 11.14.0 label Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.14.0 Issue or pull request that will be included in release 11.14.0 team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants