-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: PPOM - Metrics information from ppom is not logged #7822
Conversation
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. |
E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9524cc40-8a6a-4f0e-8e8a-96acfa937761 |
cb0335b
to
d136008
Compare
I think this might not be 100% what we expect here, as in the case the validation is complete, for one transaction we will have now x2 Confirm Started events instead of 1, so we will see suddenly more Transactions added to the wallet, which won't be the reality. We should either inform the data team about this change or look for an approach of only 1 transaction being counted (Confirm Started) as added to the wallet - no matter if there was change of validation state Ie. Transactions with Blockaid will log more "Confirm Started" events than transactions without Blockaid. I would like to clarify the behaviour. What do you think? cc @segun @cryptotavares @bschorchit |
I agree with @seaona this does not seem the desired behaviour. Should we have a specific blockaid status event that we fire for a given transaction/signature whenever the blockaid status is updated? @bschorchit @jpuri |
Also besides all the above, it would be good to add unit tests, where we check that intended metrics event fired (once and only once) and that it contained blockaid expected data |
592e3ff
to
4710098
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is looking good! 🚀
Besides @jpuri comments, I would just add some unit tests to ensure that the AnalyticsV2.trackEvent
is being called properly with the blockaid data
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7822 +/- ##
==========================================
+ Coverage 36.59% 37.09% +0.49%
==========================================
Files 1120 1130 +10
Lines 29188 29118 -70
Branches 2717 2722 +5
==========================================
+ Hits 10682 10801 +119
+ Misses 17894 17694 -200
- Partials 612 623 +11 ☔ View full report in Codecov by Sentry. |
a296e86
to
80b8a3c
Compare
80b8a3c
to
f57faa6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some comments to MessageSign tests for the reason why some tests are removed. This should apply to the TypedSign too.
…ading and the result is also sent when banner is finished loading. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Do not call setState in compoentDidUpdate Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> remove componentWillUnmount Read currentTransactionSecurityAlertResponse Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> fix unit test Do not remove listner for signature errors Move signature request into Root Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Remove fromAddress from signatureUtils. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> Fix Transaction and ApproveTransaction metrics linter fixes Only send blockaid values in metrics on sign and cancel Fix unit test Lint fix Fix unit tests Read securityAlertResponse from state for signature components Check for transactionID === currentTransactionSecurityAlertResponseId Refactor getBlockaidMetricsParams Snapshot fixes Add test for personal sign Fix typed sign unit tests Convert message sign to functional fix tests Remove comment
b31388b
to
4c8d92c
Compare
remove security alert from MessageSign
E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/92d2a9f4-943f-44f6-80d9-75dee64878f4 |
Remove securityAlert from Signature Request
b4eb2f6
to
5e05b80
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
Whenever we trigger a transaction from a dapp, we don't see any information about Blockaid validation. This is because the blockaid banner now shows loading initially for some time before the actual alert is shown. We were sending metrics only on component load, but we should send metrics for blockaid alert
The solution used here is to delay metrics for blockaid until user clicks confirm or cancel. At that point we have a definitive blockaid status to send (if it's loading, we send loading, if it's loaded we send the normal metrics).
For the deleted test cases in MessageSign (because enzyme does not support useEffect). I had a call with @cryptotavares and we will convert the tests to RTL in another PR and add the required useEffect tests there. There's no need to delay this because of that.
Related issues
Fixes: #7795
Manual testing steps
Screenshots/Recordings
Before
metrics-blockaid-mobile.mp4
After
new_metrics.mov
Pre-merge author checklist
Pre-merge reviewer checklist