Skip to content

consolidate segment setup#9617

Merged
brad-decker merged 8 commits intodevelopfrom
share-segment-implementation
Oct 21, 2020
Merged

consolidate segment setup#9617
brad-decker merged 8 commits intodevelopfrom
share-segment-implementation

Conversation

@brad-decker
Copy link
Copy Markdown
Contributor

in #9509 a good step was made to move segment setup up from one of the controllers in the background process. This goes a step further by deduplicating a big chunk of setup between the frontend and background.

Bug fix, categories aren't attached correctly for background events

Improvements

  1. adds environment_type to background events
  2. adds chain_id to all events
  3. updates network to either be the rpcUrl, if provider.type is rpc, or just provider.type otherwise.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [956a6df]
Page Load Metrics (402 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33103492110
domContentLoaded2956183998943
load2976194028943
domInteractive2956173998943

@brad-decker brad-decker marked this pull request as ready for review October 15, 2020 21:45
@brad-decker brad-decker requested a review from a team as a code owner October 15, 2020 21:45
@brad-decker brad-decker force-pushed the share-segment-implementation branch from 956a6df to e1b0552 Compare October 16, 2020 19:08
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [e1b0552]
Page Load Metrics (411 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint328942157
domContentLoaded24763440911254
load24963541111254
domInteractive24763340811254

Copy link
Copy Markdown
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

I'm a big fan of this change!

My comments are mostly nits and questions, but there's on thing re: the metaMetricsSendCount that we need to address in this or (I think I'd prefer) a later PR.

// to be updated to work with the new tracking plan. I think we should use
// a config setting for this instead of trying to match the event name
const isSendFlow = Boolean(event.match(/^send|^confirm/u))
if (isSendFlow && metaMetricsSendCount && !sendCountIsTrackable(metaMetricsSendCount + 1)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at the ConfirmTransactionBase component, aren't we racing to increment the metaMetricsSendCount?

This may be a preexisting problem, but we should increment and update metaMetricsSendCount in a single place, ideally in some MetaMetrics handler function.

It's OK if we do that in a separate PR, but we should absolutely do it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll address this in a separate PR

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c04720e]
Page Load Metrics (484 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint308241115
domContentLoaded30377148213766
load30877248413766
domInteractive30277148213766

@brad-decker
Copy link
Copy Markdown
Contributor Author

@rekmarks I addressed your feedback in the latest commit

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d1bbc20]
Page Load Metrics (390 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint297839126
domContentLoaded3006293889144
load3026313909144
domInteractive3006293889144

@brad-decker
Copy link
Copy Markdown
Contributor Author

made those requested changes @rekmarks! thanks for the feedback.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [caa5ee0]
Page Load Metrics (407 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29403432
domContentLoaded29367640512460
load29567740712560
domInteractive29367540512460

rekmarks
rekmarks previously approved these changes Oct 19, 2020
Copy link
Copy Markdown
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

@brad-decker brad-decker added the DO-NOT-MERGE Pull requests that should not be merged label Oct 20, 2020
@brad-decker
Copy link
Copy Markdown
Contributor Author

Waiting for a review from @Gudahtt before I merge as he expressed interest in doing so; I want to get additional buy-in on the approach as it's the first shared module. Thanks for your reviews, @rekmarks. I've already incorporated these changes into my WIP branches off of this one to great effect.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [b47fbb3]
Page Load Metrics (445 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint307738105
domContentLoaded29875344313766
load29975544513766
domInteractive29775344313766

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [1fd82aa]
Page Load Metrics (404 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint307838105
domContentLoaded29570040212359
load29670140412359
domInteractive29569940212359

@brad-decker brad-decker removed the DO-NOT-MERGE Pull requests that should not be merged label Oct 21, 2020
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@brad-decker brad-decker merged commit e5688c0 into develop Oct 21, 2020
@brad-decker brad-decker deleted the share-segment-implementation branch October 21, 2020 21:10
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants