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

fix: incorrect event source in analytics and connection #12478

Merged
merged 19 commits into from
Nov 28, 2024

Conversation

abretonc7s
Copy link
Contributor

@abretonc7s abretonc7s commented Nov 28, 2024

Description

Some events in our analytics system were incorrectly identifying their source, particularly for different connection types (SDK, WalletConnect, and In-App Browser connections). This PR introduces a centralized approach to determine event sources through a new useOriginSource hook and improves the source tracking implementation across components.

Key Changes

  • Created new useOriginSource hook to standardize source determination logic
  • Extracted UUID validation into a separate utility function
  • Updated analytics tracking in PermissionApproval and AccountConnect components
  • Enhanced logging capabilities for better debugging
  • Added comprehensive test coverage for new utilities

Related issues

Fixes:

Manual testing steps

  1. Test SDK connection flow
    • Connect via SDK integration
    • Verify correct source tracking in analytics
  2. Test WalletConnect flow
    • Connect via WalletConnect
    • Verify source is properly tracked
  3. Test In-App Browser flow
    • Connect via browser
    • Confirm analytics show correct source

Screenshots/Recordings

Before

image

After

image

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.

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.

@metamaskbot metamaskbot added the team-sdk SDK team label Nov 28, 2024
@abretonc7s abretonc7s added the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label Nov 28, 2024
@abretonc7s abretonc7s changed the title fix: incorrect event source when establishing connection fix: incorrect event source in analytics and connection Nov 28, 2024
@abretonc7s abretonc7s marked this pull request as ready for review November 28, 2024 07:33
@abretonc7s abretonc7s requested review from a team as code owners November 28, 2024 07:33
@abretonc7s abretonc7s added No QA Needed Apply this label when your PR does not need any QA effort. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Nov 28, 2024
@christopherferreira9 christopherferreira9 added the Run Smoke E2E Triggers smoke e2e on Bitrise label Nov 28, 2024
Copy link
Contributor

github-actions bot commented Nov 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 8237015
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4399690b-feb8-481c-bf0f-ca3f9d75cf27

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@christopherferreira9 christopherferreira9 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 28, 2024
Copy link
Contributor

@tommasini tommasini 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
Contributor

@christopherferreira9 christopherferreira9 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 for SDK. Was dev tested and analytics will be monitored with it

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit e7ee604 Nov 28, 2024
51 of 52 checks passed
@christopherferreira9 christopherferreira9 deleted the sdkevents branch November 28, 2024 20:47
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
@metamaskbot metamaskbot added the release-7.37.0 Issue or pull request that will be included in release 7.37.0 label Nov 28, 2024
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.37.0 Issue or pull request that will be included in release 7.37.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants