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: app event manager and attribution id parameters #11318

Merged
merged 18 commits into from
Sep 23, 2024
Merged

Conversation

abretonc7s
Copy link
Contributor

@abretonc7s abretonc7s commented Sep 19, 2024

Description

When a user is redirected to MetaMask Mobile app thanks to a deep link, including an attributionId parameter:

metamask://open.browser/website_url?attributionId=xyz
(deep link above is just a placeholder)

Then MM Mobile app should attach attributionId as a property to an event emitted right after Mobile app opens.
Given Mobile app would open and directly redirect the user to the in-app browser, the "App Opened" event might be a good candidate.

Related issues

Files: jira issue:

Manual testing steps

  1. Open deeplink container url and check event on segment

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.

@abretonc7s abretonc7s self-assigned this Sep 19, 2024
@abretonc7s abretonc7s requested review from a team as code owners September 19, 2024 13:21
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.

@github-actions github-actions bot added the team-sdk SDK team label Sep 19, 2024
@abretonc7s abretonc7s added the No QA Needed Apply this label when your PR does not need any QA effort. label Sep 19, 2024
abretonc7s and others added 5 commits September 19, 2024 22:09
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR is an update to the SDK communication protocol that allows the
following:
- prevent deleting connection until server confirmation
- emit rejection event 

## **Related issues**

- MetaMask/metamask-sdk#1020
- MetaMask/metamask-sdk#1022

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
@abretonc7s abretonc7s changed the title feat: attribution id parameter in deeplinks feat: app event manager and attribution id parameters Sep 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 55.89%. Comparing base (20df5be) to head (decac43).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
app/components/Nav/App/index.js 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11318      +/-   ##
==========================================
+ Coverage   55.87%   55.89%   +0.01%     
==========================================
  Files        1587     1593       +6     
  Lines       37651    37799     +148     
  Branches     4505     4533      +28     
==========================================
+ Hits        21039    21127      +88     
- Misses      16116    16173      +57     
- Partials      496      499       +3     

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

@gauthierpetetin gauthierpetetin added the release-7.32.0 Issue or pull request that will be included in release 7.32.0 label Sep 20, 2024
@gauthierpetetin
Copy link
Contributor

Adding release-7.32.0 on this PR to make sure we cherry-pick it. cc @Cal-L @sethkfman for visibility

Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

The new class could benefit from being split in a way that matches the actual process more semantically.
Understanding what this does is not easy and I see a risk of this becoming a "catch-all" place under the synonym "manager" name.
Refactoring into a more modular code now, given it's still fairly simple, could prevent many issues later and make this part more readable.

app/core/Analytics/MetaMetrics.events.ts Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
app/core/AppStateManager.test.ts Outdated Show resolved Hide resolved
NicolasMassart
NicolasMassart previously approved these changes Sep 20, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Thanks for the very interesting discussion and for your care about the codebase!

NicolasMassart
NicolasMassart previously approved these changes Sep 20, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Thanks for these last changes.

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

left a comment

app/components/Nav/App/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Sep 23, 2024

@abretonc7s abretonc7s added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit e99b5ca Sep 23, 2024
36 checks passed
@abretonc7s abretonc7s deleted the attributionid branch September 23, 2024 16:07
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2024
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 23, 2024
@gauthierpetetin
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.32.0 Issue or pull request that will be included in release 7.32.0 release-7.33.0 Issue or pull request that will be included in release 7.33.0 team-sdk SDK team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants