Commit Graph

41 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
70d5e1868a Make 'room list catch-up' analytics transaction network aware (#6233)
* Make 'room list catch-up' analytics transaction network aware.
* Add `RoomListService.isInitialSyncDone`. Use this to simplify `DefaultAnalyticsRoomListStateWatcher`'s logic.
2026-03-03 13:16:58 +01:00
Jorge Martin Espinosa
2f80b101c5 Add extra analytics for notification performance (#6237)
* Add extra analytics for notification performance

Add technical spans to track how long a notification fetching work request takes to run, then how long it takes to actually fetch the events for the notifications

* Remove `withContext(io)` for `FetchNotificationsWorker`

The default `Dispatchers.Default` dispatcher used should be good enough and more performant

* Add network check span
2026-02-24 13:39:32 +01:00
Jorge Martin Espinosa
71031008dd Adjust metrics to the new specifications (#5937)
* Add `AnalyticsTransactions` with a set of `TransactionDefinition` items matching those in the user story

* Use that for `AnalyticsLongRunningTransactions`, make sure we send the right fields (name, operation, description)

* Add `AnalyticsSendMessageWatcher` to track how long it takes for an event to be sent and for us to get a call back for that from sync

* Add `Noop` implementation for enterprise
2026-01-05 16:23:26 +01:00
Jorge Martín
7fe3b18699 Distinguish between indexable and non-indexable extra data 2025-12-18 14:08:38 +01:00
Jorge Martín
7e3acd6b58 Add Sentry transaction so we can check how long it takes to vacuum and if there were any errors when doing it 2025-12-10 15:22:16 +01:00
Jorge Martín
739f12d603 Replace AnalyticsSdkSpanFactory with AnalyticsSdkManager.
`AnalyticsSdkManager` also enables and disables Sentry logging in the SDK based on analytics user content.
2025-12-04 12:17:52 +01:00
Jorge Martín
6dd6ce1ad4 Add missing doc 2025-12-04 12:17:52 +01:00
Jorge Martín
11f41629c1 Allow bridging Sentry spans to the SDK ones.
Add distributed tracing for `Room.timelineWithConfiguration`, so we can inspect the associated Rust trace.
2025-12-04 12:17:52 +01:00
Jorge Martín
29117ce93d Add AnalyticsService.cancelLongRunningTransaction and AnalyticsService.finishLongRunningTransaction 2025-11-28 14:15:54 +01:00
Jorge Martín
71bfffe58f Move analytic watchers to :services:analytics 2025-11-28 14:15:54 +01:00
Jorge Martín
93feed38bf Add transaction trees for opening a room so we can have a nice trace view 2025-11-28 14:15:54 +01:00
Jorge Martín
2a011bf072 Add OpenRoom long running analytic transaction 2025-11-28 14:15:54 +01:00
Jorge Martín
c0e66e9d49 Add another performance check for cold start time until the cached room list is displayed 2025-11-28 14:15:54 +01:00
Jorge Martín
5681d7c611 Add a performance check for notification tap -> populated timeline time 2025-11-28 14:15:54 +01:00
Jorge Martín
1b868e73c7 Add a 'warm' room list performance check:
We want to measure how long it takes the SDK to update the room list when the app comes back from being in background.

Note we don't want to check this in cold starts, only warm ones.
2025-11-28 14:15:54 +01:00
Jorge Martín
766c23721e Have long running analytic transactions return actual transactions.
Also add `AnalyticsService.getLongRunningTransaction` and change `AnalyticsService.stopLongRunningTransaction` to `removeLongRunningTransaction`.
2025-11-28 14:15:54 +01:00
Jorge Martin Espinosa
c6c2f4a267 Add some performance metrics for Sentry (#5760)
- Add `AnalyticsService.startTransaction(...)` to start a logging transaction that can be uploaded to Sentry if the user enabled the analytics upload.
- Add `AnalyticsTransaction` wrapper to abstract the Sentry ones.
- Added several helper methods to improve the UX around these transactions.
- Then measure:
  - Time until the first sync, and how it ended.
  - Time until the first rooms are displayed.
  - Time to load a room or a preview.
  - Time to load a timeline.
2025-11-19 11:42:55 +00:00
Benoit Marty
1292da2a72 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
b748fcc631 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
0a0224b586 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Benoit Marty
f683728f35 Change in clear cache behavior:
- Do not reset the analytics store, so that we do not ask the user consent again => Parity with iOS.
- Do not reset the permission store, because it contains information that's related to the system permission, which cannot be retrieved otherwise => Should help with #3195.
2025-09-22 11:14:41 +02:00
Benoit Marty
77a7c0b2e5 Remember flows (#4533)
* Add Konsist test to ensure that the result of a function returning a flow is remembered.

* Remember flows before they are collected by state.

* Fix compilation issue

* Make isOnline a val.

* Make selectedUsers() a val.

* Make flow() a val.

* Make getUserConsent(), didAskUserConsent() and getAnalyticsId() some val.

* Remove Timeline.paginationStatus() and replace by direct access to the underlined flow.

* Simplify test

* userConsentFlow must be initialized before because it's used in observeUserConsent

* Fix test compilation
2025-04-04 16:50:43 +02:00
Jorge Martin Espinosa
e2febabcf6 Use embedded version of Element Call (#4470)
* Use embedded version of Element Call: for in-app room calls, the app will use an embedded version of Element Call shipped with the app instead of using an external service.

* Remove `ElementCallBaseUrlProvider` so we don't use the Element well known file to get the base URL anymore

* Remove `ElementCallConfig.DEFAULT_BASE_URL` since it's not used anymore

* Restore the usage of the custom EC base URL in developer settings as the actual base URL, it present

* Add a way to customise the embedded EC analytic credentials

* Update CI to use the EC analytic credentials as secrets

* Improve the custom URL placeholder to include the `/room` suffix
2025-03-26 09:35:21 +01:00
renovate[bot]
721becf45d fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.3.24 (#4394)
* fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.3.24

* Fix SDK changes related to:
    - OIDC authentication.
    - Element Call widget URL generation.
    - Forced trace logging in the SDK.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-03-24 17:07:44 +01:00
Benoit Marty
05fc76822a Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Benoit Marty
2b016227e9 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty
d4e6b4fa1d Remove dead code AnalyticsService.onSignOut.
DefaultAnalyticsService is observing the Session.
2024-05-28 17:37:25 +02:00
Benoit Marty
32f31855b5 Provide serverNames when available and fix issue around analytics 2024-05-14 15:58:10 +02:00
Benoit Marty
37c41131ea Improve ScreenTracker. 2024-04-02 18:12:36 +02:00
Benoit Marty
12a1cf048e Track NotificationTroubleshoot screen 2024-04-02 16:15:02 +02:00
Benoit Marty
99132f39a9 Fix analytics: spaceId have the same syntax as roomId. Use MatrixRoom.isSpace instead of MatrixPatterns.isSpaceId (#2612)
Also remoce useless orFalse() calls.
2024-03-28 12:13:49 +01:00
renovate[bot]
7e9cda3aa9 Update plugin ktlint to v12.1.0 (#2200)
* Update plugin ktlint to v12.1.0

* Run `./gradlew ktlintFormat` and fix some issues manually.

* Fix other issues reproted by Ktlint

* Limit false positives, KtLint removes unnecessary curly brace in String templates.

* Remove useless Unit

* Minor improvements over ktlint changes

* Restore `AlertDialogContent` behaviour

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-01-10 16:22:24 +01:00
Benoit Marty
43d28c5a3d No need to sort AnalyticsProvider (it was copied from PushProvider) 2023-07-21 18:12:17 +02:00
Benoit Marty
d6980025ca When clearing cache, also reset some data store in prefs/datastore. 2023-07-18 01:35:12 +02:00
Yoan Pintas
f599335572 Add ViewRoom posthog event (#669) 2023-06-27 21:44:54 +00:00
Yoan Pintas
e7e225dd3a Add JoinedRoom posthog event (#687) 2023-06-27 16:32:20 +00:00
Yoan Pintas
d2263372d2 Init analytics modules (#350) 2023-06-05 13:11:34 +00:00
Jorge Martin Espinosa
afd58f1634 Update Gradle to 8.1 and AGP to v8.0 (#329)
* Update AGP to 8.0.0.

* Set JAVA_HOME to JDK17

* Update lint version.

* Use right JDK for dependency analysis, replace deprecated env var.

* Upgrade to Gradle 8.1.

* Remove `@Supress(DSL_SCOPE_VIOLATION)` as it's no longer needed.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-17 08:49:52 +00:00
Jorge Martin Espinosa
0fb061fb2e [Room Details] Implement room details screen (#256)
* Implement Room Details screen

* Add option to create permalink from room id and alias, add share room action
2023-03-29 05:16:27 +00:00
Benoit Marty
ed73e60336 Cleanup after PR review. 2023-03-21 12:33:50 +01:00
Benoit Marty
5421957b8e Add :services:analytics modules. For now import the current plan.
This will allow to import existing class from EA and not break compatibility with existing analytics call.
2023-03-17 10:05:40 +01:00