Update analytic events

This commit is contained in:
Valere 2024-03-26 18:28:05 +01:00
parent d54e605909
commit fda38e90e5
10 changed files with 398 additions and 5 deletions

View File

@ -30,11 +30,44 @@ data class Error(
*/ */
val context: String? = null, val context: String? = null,
/** /**
* Which crypto module is the client currently using. * DEPRECATED: Which crypto module is the client currently using.
*/ */
val cryptoModule: CryptoModule? = null, val cryptoModule: CryptoModule? = null,
/**
* Which crypto backend is the client currently using.
*/
val cryptoSDK: CryptoSDK? = null,
val domain: Domain, val domain: Domain,
/**
* An heuristic based on event origin_server_ts and the current device
* creation time (origin_server_ts - device_ts). This would be used to
* get the source of the event scroll-back/live/initialSync.
*/
val eventLocalAgeMillis: Int? = null,
/**
* true if userDomain != senderDomain.
*/
val isFederated: Boolean? = null,
/**
* true if the current user is using matrix.org
*/
val isMatrixDotOrg: Boolean? = null,
val name: Name, val name: Name,
/**
* UTDs can be permanent or temporary. If temporary, this field will
* contain the time it took to decrypt the message in milliseconds. If
* permanent should be -1
*/
val timeToDecryptMillis: Int? = null,
/**
* true if the current user trusts their own identity (verified session)
* at time of decryption.
*/
val userTrustsOwnIdentity: Boolean? = null,
/**
* true if that unable to decrypt error was visible to the user
*/
val wasVisibleToUser: Boolean? = null,
) : VectorAnalyticsEvent { ) : VectorAnalyticsEvent {
enum class Domain { enum class Domain {
@ -44,18 +77,79 @@ data class Error(
} }
enum class Name { enum class Name {
/**
* E2EE domain error. Decryption failed for a message sent before the
* device logged in, and key backup is not enabled.
*/
HistoricalMessage,
/**
* E2EE domain error. The room key is known but is ratcheted (index >
* 0).
*/
OlmIndexError, OlmIndexError,
/**
* E2EE domain error. Generic unknown inbound group session error.
*/
OlmKeysNotSentError, OlmKeysNotSentError,
/**
* E2EE domain error. Any other decryption error (missing field, format
* errors...).
*/
OlmUnspecifiedError, OlmUnspecifiedError,
/**
* TO_DEVICE domain error. The to-device message failed to decrypt.
*/
ToDeviceFailedToDecrypt, ToDeviceFailedToDecrypt,
/**
* E2EE domain error. Decryption failed due to unknown error.
*/
UnknownError, UnknownError,
/**
* VOIP domain error. ICE negotiation failed.
*/
VoipIceFailed, VoipIceFailed,
/**
* VOIP domain error. ICE negotiation timed out.
*/
VoipIceTimeout, VoipIceTimeout,
/**
* VOIP domain error. The call invite timed out.
*/
VoipInviteTimeout, VoipInviteTimeout,
/**
* VOIP domain error. The user hung up the call.
*/
VoipUserHangup, VoipUserHangup,
/**
* VOIP domain error. The user's media failed to start.
*/
VoipUserMediaFailed, VoipUserMediaFailed,
} }
enum class CryptoSDK {
/**
* Legacy crypto backend specific to each platform.
*/
Legacy,
/**
* Cross-platform crypto backend written in Rust.
*/
Rust,
}
enum class CryptoModule { enum class CryptoModule {
/** /**
@ -75,8 +169,15 @@ data class Error(
return mutableMapOf<String, Any>().apply { return mutableMapOf<String, Any>().apply {
context?.let { put("context", it) } context?.let { put("context", it) }
cryptoModule?.let { put("cryptoModule", it.name) } cryptoModule?.let { put("cryptoModule", it.name) }
cryptoSDK?.let { put("cryptoSDK", it.name) }
put("domain", domain.name) put("domain", domain.name)
eventLocalAgeMillis?.let { put("eventLocalAgeMillis", it) }
isFederated?.let { put("isFederated", it) }
isMatrixDotOrg?.let { put("isMatrixDotOrg", it) }
put("name", name.name) put("name", name.name)
timeToDecryptMillis?.let { put("timeToDecryptMillis", it) }
userTrustsOwnIdentity?.let { put("userTrustsOwnIdentity", it) }
wasVisibleToUser?.let { put("wasVisibleToUser", it) }
}.takeIf { it.isNotEmpty() } }.takeIf { it.isNotEmpty() }
} }
} }

View File

@ -85,11 +85,28 @@ data class Interaction(
*/ */
MobileRoomAddHome, MobileRoomAddHome,
/**
* User switched the favourite toggle on Room Details screen.
*/
MobileRoomFavouriteToggle,
/** /**
* User tapped on Leave Room button on Room Details screen. * User tapped on Leave Room button on Room Details screen.
*/ */
MobileRoomLeave, MobileRoomLeave,
/**
* User adjusted their favourite rooms using the context menu on a room
* in the room list.
*/
MobileRoomListRoomContextMenuFavouriteToggle,
/**
* User adjusted their unread rooms using the context menu on a room in
* the room list.
*/
MobileRoomListRoomContextMenuUnreadToggle,
/** /**
* User tapped on Threads button on Room screen. * User tapped on Threads button on Room screen.
*/ */
@ -306,6 +323,18 @@ data class Interaction(
*/ */
WebRoomListRoomTileContextMenuLeaveItem, WebRoomListRoomTileContextMenuLeaveItem,
/**
* User marked a message as read using the context menu on a room tile
* in the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuMarkRead,
/**
* User marked a room as unread using the context menu on a room tile in
* the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuMarkUnread,
/** /**
* User accessed room settings using the context menu on a room tile in * User accessed room settings using the context menu on a room tile in
* the room list in Element Web/Desktop. * the room list in Element Web/Desktop.
@ -408,6 +437,18 @@ data class Interaction(
*/ */
WebThreadViewBackButton, WebThreadViewBackButton,
/**
* User clicked on the Threads Activity Centre button of Element
* Web/Desktop.
*/
WebThreadsActivityCentreButton,
/**
* User clicked on a room in the Threads Activity Centre of Element
* Web/Desktop.
*/
WebThreadsActivityCentreRoomItem,
/** /**
* User selected a thread in the Threads panel in Element Web/Desktop. * User selected a thread in the Threads panel in Element Web/Desktop.
*/ */

View File

@ -119,6 +119,12 @@ data class MobileScreen(
*/ */
MyGroups, MyGroups,
/**
* The screen containing tests to help user to fix issues around
* notifications.
*/
NotificationTroubleshoot,
/** /**
* The People tab on mobile that lists all the DM rooms you have joined. * The People tab on mobile that lists all the DM rooms you have joined.
*/ */

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Triggered when the user runs the troubleshoot notification test suite.
*/
data class NotificationTroubleshoot(
/**
* Whether one or more tests are in error.
*/
val hasError: Boolean,
) : VectorAnalyticsEvent {
override fun getName() = "NotificationTroubleshoot"
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("hasError", hasError)
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -41,12 +41,12 @@ data class PollCreation(
enum class Action { enum class Action {
/** /**
* Newly created poll. * Newly created poll
*/ */
Create, Create,
/** /**
* Edit of an existing poll. * Edit of an existing poll
*/ */
Edit, Edit,
} }

View File

@ -27,7 +27,7 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
data class PollEnd( data class PollEnd(
/** /**
* Do not use this. Remove this property when the kotlin type generator * Do not use this. Remove this property when the kotlin type generator
* can properly generate types without proprties other than the event * can properly generate types without properties other than the event
* name. * name.
*/ */
val doNotUse: Boolean? = null, val doNotUse: Boolean? = null,

View File

@ -27,7 +27,7 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
data class PollVote( data class PollVote(
/** /**
* Do not use this. Remove this property when the kotlin type generator * Do not use this. Remove this property when the kotlin type generator
* can properly generate types without proprties other than the event * can properly generate types without properties other than the event
* name. * name.
*/ */
val doNotUse: Boolean? = null, val doNotUse: Boolean? = null,

View File

@ -0,0 +1,137 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Triggered when a moderation action is performed within a room.
*/
data class RoomModeration(
/**
* The action that was performed.
*/
val action: Action,
/**
* When the action sets a particular power level, this is the suggested
* role for that the power level.
*/
val role: Role? = null,
) : VectorAnalyticsEvent {
enum class Action {
/**
* Banned a room member.
*/
BanMember,
/**
* Changed a room member's power level.
*/
ChangeMemberRole,
/**
* Changed the power level required to ban room members.
*/
ChangePermissionsBanMembers,
/**
* Changed the power level required to invite users to the room.
*/
ChangePermissionsInviteUsers,
/**
* Changed the power level required to kick room members.
*/
ChangePermissionsKickMembers,
/**
* Changed the power level required to redact messages in the room.
*/
ChangePermissionsRedactMessages,
/**
* Changed the power level required to set the room's avatar.
*/
ChangePermissionsRoomAvatar,
/**
* Changed the power level required to set the room's name.
*/
ChangePermissionsRoomName,
/**
* Changed the power level required to set the room's topic.
*/
ChangePermissionsRoomTopic,
/**
* Changed the power level required to send messages in the room.
*/
ChangePermissionsSendMessages,
/**
* Kicked a room member.
*/
KickMember,
/**
* Reset all of the room permissions back to their default values.
*/
ResetPermissions,
/**
* Unbanned a room member.
*/
UnbanMember,
}
enum class Role {
/**
* A power level of 100.
*/
Administrator,
/**
* A power level of 50.
*/
Moderator,
/**
* Any other power level.
*/
Other,
/**
* A power level of 0.
*/
User,
}
override fun getName() = "RoomModeration"
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("action", action.name)
role?.let { put("role", it.name) }
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Super Properties are properties associated with events that are sent with
* every capture call, be it a $pageview, an autocaptured button click, or
* anything else.
*/
data class SuperProperties(
/**
* Used by web to identify the platform (Web Platform/Electron Platform)
*/
val appPlatform: String? = null,
/**
* Which crypto backend is the client currently using.
*/
val cryptoSDK: CryptoSDK? = null,
/**
* Version of the crypto backend.
*/
val cryptoSDKVersion: String? = null,
) {
enum class CryptoSDK {
/**
* Legacy crypto backend specific to each platform.
*/
Legacy,
/**
* Cross-platform crypto backend written in Rust.
*/
Rust,
}
fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
appPlatform?.let { put("appPlatform", it) }
cryptoSDK?.let { put("cryptoSDK", it.name) }
cryptoSDKVersion?.let { put("cryptoSDKVersion", it) }
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -252,6 +252,12 @@ data class ViewRoom(
*/ */
WebSpacePanelNotificationBadge, WebSpacePanelNotificationBadge,
/**
* Room accessed via interacting with the Threads Activity Centre in
* Element Web/Desktop.
*/
WebThreadsActivityCentre,
/** /**
* Room accessed via Element Web/Desktop's Unified Search modal. * Room accessed via Element Web/Desktop's Unified Search modal.
*/ */