Commit Graph

64 Commits

Author SHA1 Message Date
Benoit Marty
657a610f53 Metro 0.10.0: Classes annotated with ContributesIntoSet do not need to be annotated with Inject. 2026-01-20 10:13:39 +01:00
Jorge Martin Espinosa
28b63745f4 When a duplicate room list entry is found, report it and remove it (#6006)
* When a duplicate room list entry is found, report it and remove it

* Fix tests and fixtures

* Simplify how the updates are described in the Sentry reports
2026-01-14 10:56:45 +00:00
Jorge Martin Espinosa
536227883c Change the title for AnalyticsTransactions.coldStart and .catchUp (#5998) 2026-01-12 14:54:13 +00: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
dd7649414d Fix wrong variable being used, improve tests 2025-12-18 14:08:38 +01:00
Jorge Martín
165032ea02 Make sure we don't upload any user ids in tags either 2025-12-18 14:08:38 +01:00
Jorge Martín
515f7f4946 Add more tests to SentryAnalyticsProviderTest 2025-12-18 14:08:38 +01:00
Jorge Martín
b5d6843725 Inject SentryDsn the same way we do with SentrySdkDsn so we can fake it for tests 2025-12-18 14:08:38 +01:00
Jorge Martín
9a9e84f6c8 Add tests for SentryAnalyticsProvider 2025-12-18 14:08:38 +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
20c0d0190e Add extra code to make sure we can't upload a session/user id as an extra by mistake 2025-12-18 14:08:38 +01:00
Jorge Martín
a4b908bc18 Integrate the new use case with Sentry
We'll upload the store sizes as different fields so we can later use them to filter transaction/issues
2025-12-18 14:08:38 +01:00
Jorge Martín
18482a99e3 Add AnalyticsUserData, with keys for several extras we want to upload to Sentry.
Add the `HOMESERVER` extra, with a hashed homeserver value. This is only so we can identify devices using a problematic HS (like matrix.org under heavy load).
2025-12-18 14:08:38 +01:00
Jorge Martín
367bbc7e4b Create addUserData method in the analytics providers
This allows us to globally add arbitrary data to the events and transactions
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
9e997a2fa6 Fix: use the right BuildTimeConfig field for the SDK DSN
We were using `SERVICES_SENTRY_SDK_DSN`, but the enterprise template uses `SERVICES_SENTRY_DSN_RUST`
2025-12-04 22:53:39 +01:00
Jorge Martín
b31267d7c7 Make SentrySdkDsn a value class instead of a qualifier 2025-12-04 12:17:52 +01:00
Jorge Martín
c7a5ce152e Fix providing the Sentry SDK DSN in Element Pro when no analytic modules are enabled 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
53ab38d990 Enable Sentry in the SDK: add SDK Sentry DSN value
This is provided to the SDK in `PlatformInitializer`.
2025-12-04 12:17:52 +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 Martin Espinosa
8718bd5239 Add NIGHTLY env for Sentry (#5779)
Previously, nightly issue reports and performance transactions were uploaded to 'DEBUG', which may make sense for issues, but not for performance traces.
2025-11-20 15:17:32 +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
629fc552e5 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
Jorge Martín
dca1c5b516 Remove dagger and anvil dependencies, try to simplify gradle build scripts a bit 2025-09-04 16:49:21 +02:00
Jorge Martín
e06bacbff3 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín
fc3153bd26 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín
92a4b8b66b Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
Benoit Marty
e8e75af506 Update "Learn more" link (#4686)
* Update target link for "Learn more".

* Rename VerifySelfSession* to OutgoingVerification*

* Optimize import

* Refactor to avoid long line

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-09 11:10:30 +02:00
Benoit Marty
87fd1372a9 Element config (#4471)
* Add handy extension "VariantDimension.buildConfigFieldStr"

* Update configuration for MapTiler.

* Update configuration for Sentry.

* Build AnalyticsConfig depending on analytics configuration.

* Configure analytics policy url.

* Add handy extension "VariantDimension.buildConfigFieldBoolean"

* Configure legal urls.

* Add a way to disable rageshake / reporting bugs.

* Update screenshots

* Quality

* Fix test

* Use `ifBlank` extension

* Add missing configuration for PostHog

* Update configuration for Rageshake.

* Add build log.

* Disable crash detection if rageshake feature is not available.
Disabled twice.

* Hide link to analytics policy if the link is missing.

* Fix test when run in enterprise context.

* Use RageshakeFeatureAvailability where appropriate.

* Rename file.

* Move some classes to their correct module.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-27 11:25:04 +01:00
Jorge Martin Espinosa
620457705c Use Sentry breadcrumbs instead of logging new events (#4223) 2025-01-31 11:55:35 +01:00
Jorge Martin Espinosa
c935783a78 Use secret Sentry DSN value (#4210)
* Use secret Sentry DSN value.

We realised our DSN entry has been shipped along with the code and it was being used in several forks as is, resulting in wrong bug reports coming into our Sentry dashboard and making it very hard to debug actual issues in the app.
2025-01-29 13:47:06 +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
Jorge Martin Espinosa
2efdb3ae45 Centralise the DI code generation logic (#3562)
* Create Anvil extension helper

* Use the helper everywhere
2024-09-30 12:20:28 +00:00
Benoit Marty
62a6e916a6 Migrate license to AGPL - XML files. 2024-09-06 17:43:35 +02: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
c9c0413c40 Ensure Posthog is only used for Element builds. 2024-06-04 17:04:19 +02:00
Valere
c9294fd1bf Add missing impl in Sentry 2024-05-31 14:07:03 +02:00
Valere
3c98a843e5 Analytics | Add support for SuperProperties 2024-05-31 14:07:02 +02:00
Benoit Marty
9d50ef06a2 Cleanup import 2024-05-29 01:54:06 +02:00
Benoit Marty
d4ea1da729 Add test on DefaultAnalyticsService 2024-05-28 18:27:53 +02:00
Valere
94bbcbf503 Code review - more tests 2024-05-07 09:38:26 +02:00
Valere
c430699711 Add support for Verification state analytics 2024-05-06 19:06:54 +02:00
Benoit Marty
b8e8578fad Add extra properties "cryptoSDK" to Error.CryptoSDK.Rust to all events and screen sent to PostHog. 2024-03-15 11:27:53 +01:00
ganfra
4052abf15c Analytics : add analytics on read status and favorite toggles 2024-02-19 17:38:17 +01:00
Benoit Marty
378692f743 Fix moar ktlint issues 2024-01-11 10:02:10 +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