Fix version on Segment for desktop app#430
Conversation
There was a problem hiding this comment.
This is needed so that browser.runtime.getManifest() returns a version_name field that, for extension builds, is based on the version from package.json + build type (e.g. 10.23.2-desktop.0, 10.23.2-flask.0).
With this change, for the desktop app right now, version_name: 0.0.1-desktop.0.
The version is passed to the MetaMetrics controller and used to report segment stats (https://github.com/MetaMask/desktop-extension/blob/main/app/scripts/metamask-controller.js#L424)
0eb9144 to
f325cc4
Compare
There was a problem hiding this comment.
We also need to ensure METAMASK_ENVIRONMENT is set as 'production' for the production build, as otherwise it appends an unknown to the version (https://github.com/MetaMask/desktop-extension/blob/main/app/scripts/controllers/metametrics.js#L125).
We can also set METAMASK_ENVIRONMENT in our local build if we want to avoid -unknown being appended.
f325cc4 to
b2506ed
Compare
b2506ed to
e397ca3
Compare
There was a problem hiding this comment.
I think I did this a while back but I can't recall if this is the browser version or if it should be the numerical portion of the version_name below?
There was a problem hiding this comment.
It is the numerical portion of the version_name indeed.
version: "10.23.2.0"
version_name: "10.23.2-desktop.0"
Probably best to match the behaviour whilst we are at it just in case.
e397ca3 to
5e38559
Compare
Context
Fix how version is displayed for Segment metrics that come from MetametricsController when desktop app is paired.
Changes
App
version_nameproperty so that the desktop version is displayed.METAMASK_ENVIRONMENTenv to our package pipelines so that the version is built as expected within the MetametricsController.Links to the relevant code that affects these changes provided in comments.
Screenshots