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

chore: reorder accounts in ETH_REQUESTACCOUNTS response to prioritize selectedAddress in the 'AndroidService' #10213

Merged

Conversation

omridan159
Copy link
Contributor

@omridan159 omridan159 commented Jul 2, 2024

Description

Summary

This PR implements logic to reorder the accounts in the ETH_REQUESTACCOUNTS response, ensuring that the selected address appears first in the list. This update is part of the sendMessage method in the AndroidService class.

Changes

  • Retrieve the selected address from the PreferencesController.
  • Convert all account addresses in the response to lowercase.
  • Check if the selected address is part of the connected addresses.
  • Reorder the accounts list, placing the selected address at the beginning if it exists in the list.
  • Update the message data with the reordered accounts list.

Why

Reordering the accounts list enhances user experience by making the selected address more prominent and easily accessible. This change ensures that the selected address is always the first in the list returned by the ETH_REQUESTACCOUNTS method.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

@omridan159 omridan159 requested review from a team as code owners July 2, 2024 06:31
Copy link
Contributor

github-actions bot commented Jul 2, 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.

@omridan159 omridan159 self-assigned this Jul 2, 2024
@omridan159 omridan159 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-sdk SDK team needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Jul 2, 2024
Copy link

sonarcloud bot commented Jul 2, 2024

@christopherferreira9 christopherferreira9 added QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jul 2, 2024
@christopherferreira9
Copy link
Contributor

christopherferreira9 commented Jul 2, 2024

Test cases:

  • Resume session with Android SDK Dapp after killing MM
  • Resume session with Android SDK Dapp after restarting the dapp
  • Account sync

Skipping E2E since these changes are strict to the Android service that is currently not covered on E2E

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done No E2E Smoke Needed If the PR does not need E2E smoke test run and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) QA in Progress QA has started on the feature. labels Jul 2, 2024
Copy link
Contributor

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherferreira9 christopherferreira9 merged commit 1f9af51 into main Jul 2, 2024
47 of 50 checks passed
@christopherferreira9 christopherferreira9 deleted the chore_update-sendMessage-method-in-AndroidService branch July 2, 2024 13:29
@github-actions github-actions bot locked and limited conversation to collaborators Jul 2, 2024
@metamaskbot metamaskbot added the release-7.27.1 Issue or pull request that will be included in release 7.27.1 label Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run QA Passed A successful QA run through has been done release-7.27.1 Issue or pull request that will be included in release 7.27.1 team-sdk SDK team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants