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: android sdk connection management #8291

Merged
merged 7 commits into from
Jan 18, 2024

Conversation

abretonc7s
Copy link
Contributor

@abretonc7s abretonc7s commented Jan 16, 2024

Description

Improvement in android sdk connection management to restore session persistence behavior.
Prevent flickering when cleaning connection with android sessions and add an online status over connected sessions.

Related issues

Manual testing steps

Screenshots/Recordings

Before

image

After

image ## **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.

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.

@abretonc7s abretonc7s marked this pull request as ready for review January 16, 2024 13:43
@abretonc7s abretonc7s requested a review from a team as a code owner January 16, 2024 13:43
@abretonc7s abretonc7s added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-sdk SDK team labels Jan 16, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/eb2cc635-df96-4ca2-bef2-78381fef832b
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@andreahaku andreahaku added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jan 16, 2024
andreahaku
andreahaku previously approved these changes Jan 16, 2024
Copy link
Member

@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

@andreahaku andreahaku added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Jan 16, 2024
@christopherferreira9
Copy link
Contributor

Should fix: #8034

@christopherferreira9 christopherferreira9 added QA in Progress QA has started on the feature. QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. QA in Progress QA has started on the feature. labels Jan 16, 2024
@christopherferreira9
Copy link
Contributor

Issue 1: Connecting once presents 2 connections in the connection list while only one of them is set to "active"
Issue 2: The first connection in the connections list cannot be removed (seems to be related to issue 1)
Issue 3: After killing the dapp and opening again to trigger session persistence you're presented with the connection prompt. It should simply resume and go back to dapp. This is still an improvement compared to #8291 where you would get 2 connection requests.

Screen.Recording.2024-01-16.at.15.43.52.mov

@christopherferreira9
Copy link
Contributor

E2E CI passed here

@codecov-commenter
Copy link

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (f791282) 40.21% compared to head (c7c6621) 40.21%.

Files Patch % Lines
app/core/SDKConnect/AndroidSDK/AndroidService.ts 0.00% 17 Missing ⚠️
...ts/Views/SDKSessionsManager/SDKSessionsManager.tsx 0.00% 10 Missing ⚠️
...onents/Views/SDKSessionsManager/SDKSessionItem.tsx 0.00% 3 Missing ⚠️
.../core/SDKConnect/ConnectionManagement/reconnect.ts 0.00% 2 Missing ⚠️
...e/SDKConnect/ConnectionManagement/removeChannel.ts 71.42% 0 Missing and 2 partials ⚠️
app/core/RPCMethods/RPCMethodMiddleware.ts 0.00% 1 Missing ⚠️
...ion/EventListenersHandlers/handleClientsWaiting.ts 50.00% 1 Missing ⚠️
...DKConnect/ConnectionManagement/connectToChannel.ts 0.00% 1 Missing ⚠️
...re/SDKConnect/ConnectionManagement/reconnectAll.ts 50.00% 0 Missing and 1 partial ⚠️
.../core/SDKConnect/ConnectionManagement/removeAll.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8291      +/-   ##
==========================================
- Coverage   40.21%   40.21%   -0.01%     
==========================================
  Files        1235     1236       +1     
  Lines       29885    29913      +28     
  Branches     2863     2870       +7     
==========================================
+ Hits        12018    12029      +11     
- Misses      17176    17191      +15     
- Partials      691      693       +2     

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

Copy link

sonarcloud bot commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
36.1% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@christopherferreira9
Copy link
Contributor

All issues are now fixed

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Jan 17, 2024
Copy link
Member

@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 c681f89 into main Jan 18, 2024
22 of 28 checks passed
@christopherferreira9 christopherferreira9 deleted the android-sdk-improvements branch January 18, 2024 10:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
@metamaskbot metamaskbot added the release-7.16.0 Issue or pull request that will be included in release 7.16.0 label Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.16.0 Issue or pull request that will be included in release 7.16.0 team-sdk SDK team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants