Commit Graph

106 Commits

Author SHA1 Message Date
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
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
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
f0a6a0037c Let element enterprise be able to configure id for mapTiler. (#4446)
* Let element enterprise configure the ids for maptiler service.

* Disable location sharing and location viewer is the service is not available.

* Fix compilation issue on connected test

* Do not allow to reload the map if the mapId is not available.

* Update screenshots

* Rename file.

* Better to inject a string provider here, so we can unit test DefaultLocationService.

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-21 17:06:52 +01:00
Jorge Martin Espinosa
c040cec108 Create SyncOrchestrator (#4176)
* Create `SyncOrchestrator` to centralise the sync start/stop flow through the whole app: the decision is based on several inputs: sync state, network available, app in foreground, app in call, app needing to sync an event for a notification.

* Make network monitor return network connectivity status, not internet connectivity

* Don't stop the `SyncService` when network connection is lost, let it fail instead. This prevents an issue when using the offline mode of the SDK, which made the wrong UI states to be shown when the `SyncState` is `Idle` (that is, after the service being manually stopped).

* Rename `NetworkStatus.Online/Offline` to `Connected/Disconnected` so they're not easily mistaken with internet connectivity instead
2025-02-06 16:36:57 +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
31a7d3f3bb Fix pagination restart issue and cover by unit test. 2025-01-23 17:49:42 +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
df86e92d61 Fix test present - with CallType RoomCall sets call as active, loads URL, runs WidgetDriver and notifies the other clients a call started not passing. 2024-10-30 21:00:52 +01:00
Benoit Marty
4d554de838 Merge pull request #3554 from element-hq/feature/bma/testEmptyTimeline
Add unit tests on TimelineItemsSubscriber
2024-10-02 14:04:48 +02:00
Jorge Martin Espinosa
4a43fcb69a Use Anvil KSP instead of the Square KAPT one (#3564)
* Use Anvil KSP instead of the Square KAPT one

* Fix several configuration cache, lint and test issues

* Allow incremental kotlin compilation in the CI

* Workaround Robolectric + Compose issue that caused `AppNotIdleException`

* Update the `enterprise` commit hash

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2024-10-02 11:52:17 +00: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
015d59af13 Remove runCancellableScopeTest and runCancellableScopeTestWithTestScope, we can use TestScope.backgroundScope instead. 2024-09-27 18:37:16 +02:00
ganfra
fb694c50fe Pinned messages analytics : branch analytics 2024-09-23 20:10:04 +02:00
ganfra
e1f88a9232 Pinned messages analytics : introduce LocalAnalyticsService so we can easily inject it in views 2024-09-20 18:28:25 +02:00
Jorge Martin Espinosa
03786c1fd2 Add forced logout flow when the proxy is no longer available (#3458)
* Add `MatrixClient.isSlidingSyncProxySupported` function

* Update localazy strings

* Modify `ErrorDialog` to have an `onSubmit` call, which will be used for the submit action.

Also make the title text optional and dismissing the dialog by tapping outside/going back configurable.

* Check if a forced migration to SSS is needed because the proxy is no longer available.

In that case, display the non-dismissable dialog and force the user to log out after enabling SSS.

* Enable native/simplified sliding sync by default.

* Refactor the login to make sure we:

1. Always try native/simplified sliding sync login first, if available.
2. Then, if it wasn't available or failed with an sliding sync not supported error, try with the proxy instead (either discovered proxy or forced custom one).

* Move logic to `LoggedInPresenter` and the UI to `LoggedInView`

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-09-16 09:13:02 +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
ganfra
0969470066 tests : refactor some classes 2024-07-31 21:14:29 +02:00
Jorge Martin Espinosa
950e502ca6 Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
Benoit Marty
038b60a271 Merge pull request #3044 from element-hq/feature/bma/testDefaultClearCacheUseCase
Add test on DefaultClearCacheUseCase
2024-06-18 10:27:45 +02:00
Jorge Martin Espinosa
feef0f6976 Add full screen intent permissions banner (#3024)
* Add full screen intent permissions banner, creating `:libraries:fullscreenintent` modules.
* Add it to notification settings too:
    - Create `libraries:fullscreenintent` modules for the permission presenter and associated data.
    - Add the presenter and states to `NotificationSettingsPresenter` and `NotificationSettingsView`.
* Use the right API to check for full screen intent permissions.
- Use the right package name for `:libraries:permission` contents.
* Fix broken tests (flaky?)
* Ignore coverage verification for fake and small presenters

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-06-18 07:41:10 +00:00
Benoit Marty
cb07ccdeb9 Add test on DefaultFtueService.reset(). 2024-06-17 15:04:20 +02:00
Benoit Marty
4e3774308e Merge pull request #2970 from element-hq/feature/bma/moreAnalytics
Track when the user starts a room call and when they enable formatting options on the message composer
2024-06-05 09:21:28 +02:00
Benoit Marty
c9c0413c40 Ensure Posthog is only used for Element builds. 2024-06-04 17:04:19 +02:00
Benoit Marty
8e6bf997dc Analytics: track screen MobileScreen.ScreenName.RoomCall 2024-06-03 17:55:52 +02:00
Valere
c9294fd1bf Add missing impl in Sentry 2024-05-31 14:07:03 +02:00
Valere
bcf4e27d6f Test | Fix missing updateSuperProperties impl 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
d4f651eeda Make anId a const. 2024-05-29 00:37:28 +02:00
Benoit Marty
04cd2bf8f5 Fix compilation issue 2024-05-29 00:30:38 +02:00
Benoit Marty
d4ea1da729 Add test on DefaultAnalyticsService 2024-05-28 18:27:53 +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
6acc86641a Make AnalyticsStore an interface and create DefaultAnalyticsStore 2024-05-28 17:36:48 +02:00
Benoit Marty
32f31855b5 Provide serverNames when available and fix issue around analytics 2024-05-14 15:58:10 +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
SpiritCroc
202456ad19 Fix compile with noop analytics provider 2024-04-12 21:12:44 +02:00
Benoit Marty
37c41131ea Improve ScreenTracker. 2024-04-02 18:12:36 +02:00
Benoit Marty
e3d02b9804 FakeStringProvider: Ensure parameter are included in the result of getString() 2024-04-02 16:15:03 +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
Benoit Marty
55cbb99201 Improve UtdTracker test. 2024-03-15 12:33:54 +01: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