File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,15 @@ export interface ClientUpdateNotified {
399
399
sensitiveProperties ?: never
400
400
}
401
401
402
+ export interface ClientUpdateDownloading {
403
+ event : 'Downloading Client Update'
404
+ properties : {
405
+ currentVersion : string
406
+ newVersion : string
407
+ }
408
+ sensitiveProperties ?: never
409
+ }
410
+
402
411
export interface ClientUpdateError {
403
412
event : 'Client Update Error'
404
413
properties : {
@@ -460,6 +469,7 @@ export type PossibleMetricPayloads =
460
469
| RewardClaimSuccess
461
470
| RewardClaimError
462
471
| ClientUpdateNotified
472
+ | ClientUpdateDownloading
463
473
| ClientUpdateError
464
474
| ClientUpdateDownloaded
465
475
| PatchingStarted
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ autoUpdater.autoInstallOnAppQuit = true
21
21
22
22
let isAppUpdating = false
23
23
let hasUpdated = false
24
+ let hasReportedDownloadStart = false
24
25
25
26
let updateAttempts = 0
26
27
const MAX_UPDATE_ATTEMPTS = 10
@@ -73,6 +74,19 @@ autoUpdater.on('update-available', async (info) => {
73
74
// log download progress
74
75
autoUpdater . on ( 'download-progress' , ( progress ) => {
75
76
isAppUpdating = true
77
+
78
+ // Track download start only once
79
+ if ( ! hasReportedDownloadStart ) {
80
+ trackEvent ( {
81
+ event : 'Downloading Client Update' ,
82
+ properties : {
83
+ currentVersion : autoUpdater . currentVersion . version ,
84
+ newVersion
85
+ }
86
+ } )
87
+ hasReportedDownloadStart = true
88
+ }
89
+
76
90
logInfo (
77
91
'Downloading HyperPlay update...' +
78
92
`Download speed: ${ progress . bytesPerSecond } , ` +
@@ -88,6 +102,7 @@ autoUpdater.on('update-downloaded', async () => {
88
102
logInfo ( 'The App update was downloaded' , LogPrefix . AutoUpdater )
89
103
hasUpdated = true
90
104
isAppUpdating = false
105
+ hasReportedDownloadStart = false // Reset for potential future updates
91
106
92
107
trackEvent ( {
93
108
event : 'Client Update Downloaded' ,
You can’t perform that action at this time.
0 commit comments