@@ -719,15 +719,6 @@ class ActivityMonitor(private val project: Project, cs: CoroutineScope) : Dispos
719719 postHog?.capture(UniqueGeneratedUserId .userId, " plugin first-init" )
720720 }
721721
722- fun registerUIUpdate (eventName : String , details : Map <String , Any >) {
723- // here use postHog.capture directly, this event is called from UIVersioningService while its initializing,
724- // it cannot call the common capture method because it may cause a circular dependency between UIVersioningService
725- // and ActivityMonitor because the capture method will call UIVersioningService.getInstance().getCurrentUiVersion().
726- // although UIVersioningService initialize fast enough, there may be a race condition if the capture method calls
727- // UIVersioningService.getInstance().getCurrentUiVersion() before UIVersioningService constructor completes.
728- // also, this event doesn't need all the common properties.
729- postHog?.capture(UniqueGeneratedUserId .userId, eventName,details)
730- }
731722
732723 fun registerProjectOpened (openProjects : Int ) {
733724 capture(" project opened" , mapOf (" open.projects" to openProjects))
@@ -1138,5 +1129,34 @@ class ActivityMonitor(private val project: Project, cs: CoroutineScope) : Dispos
11381129
11391130 }
11401131
1132+ fun registerUIUpdate (
1133+ bundledVersion : String ,
1134+ currentVersion : String ,
1135+ latestDownloadedUiVersion : String ,
1136+ updateToVersion : String ,
1137+ isOnStartup : Boolean ,
1138+ isForceUpdate : Boolean
1139+ ) {
1140+
1141+ // here use postHog.capture directly, this event is called from UIVersioningService while its initializing,
1142+ // it cannot call the common capture method because it may cause a circular dependency between UIVersioningService
1143+ // and ActivityMonitor because the capture method will call UIVersioningService.getInstance().getCurrentUiVersion().
1144+ // although UIVersioningService initialize fast enough, there may be a race condition if the capture method calls
1145+ // UIVersioningService.getInstance().getCurrentUiVersion() before UIVersioningService constructor completes.
1146+ // also, this event doesn't need all the common properties.
1147+
1148+ val details = mapOf (
1149+ " bundledVersion" to bundledVersion,
1150+ " currentVersion" to currentVersion,
1151+ " latestDownloadedUiVersion" to latestDownloadedUiVersion,
1152+ " updateToVersion" to updateToVersion,
1153+ " isOnStartup" to isOnStartup,
1154+ " isForceUpdate" to isForceUpdate
1155+ )
1156+
1157+ postHog?.capture(UniqueGeneratedUserId .userId, " ui update" , details)
1158+
1159+ }
1160+
11411161
11421162}
0 commit comments