Commit Graph

647 Commits

Author SHA1 Message Date
Jorge Martin Espinosa 68023b5c74 Simplify push notification flow by using locally stored values for pending pushes (#6258)
* Create `PushRequest` in push history DB: this will be used to store requests for push notifications, either pending or completed ones.

* Rename `WorkManagerRequest` to `WorkManagerRequestBuilder`: make its `build` method return a list of `WorkManagerRequestWrapper`, which can be used to enqueue normal or unique workers.

* Rename `PerformDatabaseVacuumRequestBuilder` and adapt it to the new API.

* Adjust other components using `WorkManagerRequest`.

* Replace `SyncNotificationWorkManagerRequestBuilder` with `SyncPendingNotificationsRequestBuilder` and `FetchNotificationsWorker` with `FetchPendingNotificationsWorker`: this new pair of request builder and worker allow enqueuing requests for a session id and, once the worker runs, retrieve all the pending request data and use it to fetch the associated events. This simplifies quite a bit how this data had to be passed or grouped, since it's no longer necessary to do so

* Add new methods to `PushHistoryService` to modify the `PushDatabase`:

- insertOrUpdatePushRequest
- insertOrUpdatePushRequests
- getPendingPushRequests
- removeOldPushRequests

* Make `PushHandler` just handle incoming pushes: those will be inserted into the pending push request table in DB, then handled by the new worker. Once the process finished, a new `NotificationResultProcessor` will handle the results and what needs to be done with them (call ringing, displaying notifications, etc.)

* Add `requestType` optional parameter to `WorkManagerScheduler.cancel` so we can decide to only cancel some kinds of requests.

* Add migration to remove existing work manager requests for fetching notifications, since the previous worker class no longer exists.
2026-03-03 15:14:36 +00:00
renovate[bot] 2b04c4bfc0 Update metro to v0.11.2 (#6270)
* Update metro to v0.11.2

* Bind push tests to the right scope .Add a comment so we don't forget to do it for future ones.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-03-03 13:39:43 +01:00
Benoit Marty b65b9eeab9 Merge pull request #6035 from element-hq/fix/remove-fragment-part-in-mxc-urls
Add `MediaSource.safeUrl` for removing invalid fragment part from URLs
2026-03-03 11:57:49 +01:00
Benoit Marty b0bcb248a1 Merge pull request #6241 from element-hq/feature/bma/fixRedactedNotification
Ensure that redacted event from encrypted room does not trigger a fallback notification
2026-03-03 11:43:45 +01:00
ElementBot cf479a8df0 Sync Strings from Localazy (#6269)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-03-02 14:54:50 +01:00
Benoit Marty 43319f6e90 Handle EventRedacted case. Fixes #5569 2026-03-02 09:15:53 +01:00
Jorge Martín 5fb9dcb0da Apply suggestion:
- Added `MediaSource.safeUrl` property replacing `withCleanUrl` method.
- Made `url` private so it can't be used externally.
- Reverted code in `CoilMediaFetcher`
- Also add tests
2026-02-27 09:52:17 +01:00
renovate[bot] 896d62a81e Update metro to v0.11.0 (#6245)
* Update metro to v0.11.0

* Fix `@AssistedInject` usages

Now the injected variables in the factories must match the names in the constructors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-02-25 16:19:47 +01:00
Jorge Martin Espinosa 4fb6346d4b Check if network access if blocked when fetching notifications (#6247)
* Add `NetworkMonitor.isNetworkBlocked()`, use it to check if Doze prevented us from loading notifications

* Only check if network is blocked after checking if we have a network available, otherwise it's always `true`

* Extract `NetworkBlockedChecker` to handle deprecations more carefully
2026-02-25 12:04:07 +00:00
Jorge Martin Espinosa ce3df764ba 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
bmarty 25c723c35a Sync Strings from Localazy 2026-02-23 00:39:49 +00:00
Benoit Marty 95f150852c Fix compilation issue after merging develop. 2026-02-13 16:44:42 +01:00
Benoit Marty 35e60efae2 Merge branch 'develop' into feature/bma/notificationCustomSound 2026-02-13 15:48:19 +01:00
Benoit Marty ab1af452c6 Add name parameters 2026-02-12 17:57:52 +01:00
Benoit Marty bed65b3950 Swap receiver and parameter for a nicer code. 2026-02-12 17:57:31 +01:00
Benoit Marty 7f356f2603 Fix typo 2026-02-12 14:42:58 +01:00
Benoit Marty 50264a9ab0 Ignore fallback notification when the room list is rendered.
Add more tests.
2026-02-12 13:30:46 +01:00
Benoit Marty 73c3ffac2d Improve FakeAppNavigationStateService 2026-02-12 13:30:06 +01:00
Benoit Marty b604b062b4 Dismiss fallback notification when the room list is rendered. 2026-02-12 13:26:53 +01:00
Benoit Marty 6ec35db9d4 Remove NavigationState.Space. (#6185)
* Remove `NavigationState.Space`.
We do not have the concept of current space.

* Fix test.
2026-02-12 13:24:51 +01:00
Benoit Marty 0f0f09b4c0 Fix test. 2026-02-12 09:12:17 +01:00
Benoit Marty 3a86605ee9 Merge branch 'develop' into feature/bma/notificationFallbackCounter 2026-02-11 21:10:14 +01:00
Benoit Marty 21f65a119e Add missing test 2026-02-11 21:06:19 +01:00
Benoit Marty 414e7ab9c6 Cleanup 2026-02-11 20:51:05 +01:00
Benoit Marty f93dfbdae4 Remove NavigationState.Space.
We do not have the concept of current space.
2026-02-11 20:41:55 +01:00
Benoit Marty 40d8722170 Rely on the SessionObserver to detect a sign out. 2026-02-11 18:06:32 +01:00
Benoit Marty fe7e67c683 Notification: implement a counter in the fallback notification. 2026-02-11 16:43:03 +01:00
Benoit Marty cd9a1febc4 Cleanup: remove unused summaryLine field. 2026-02-11 15:36:12 +01:00
Benoit Marty df4c719151 Let enterprise build be able to use a different notification channel for noisy notification. 2026-02-11 11:57:01 +01:00
Benoit Marty abae0314e2 Remove file sound (it is the same file than the file in the main scope). 2026-02-10 18:13:09 +01:00
Benoit Marty 9961644185 Format file. 2026-02-10 17:40:20 +01:00
ElementBot 7c95f824d5 Sync Strings from Localazy (#6155)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-02-09 16:30:57 +01:00
ElementBot 3ab67a5e15 Sync Strings from Localazy (#6085)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-01-26 12:06:38 +01:00
Jorge Martin Espinosa 57e0b74482 Use MediaPreviewValue.Private to check if media should be displayed in notifications (#6038)
* Use `MediaPreviewValue.Private` to check if images should be displayed in notifications

Also added `NotificationData.roomJoinRule` so we can use it to check if the room is public or not

* Add logging message for cases when we should have an image uri it turns out we don't
2026-01-23 09:01:52 +00:00
Benoit Marty c901772145 Metro 0.10.0: Classes annotated with ContributesIntoSet do not need to be annotated with Inject. 2026-01-20 10:13:39 +01:00
bmarty 45ed8619dd Sync Strings from Localazy 2026-01-19 00:35:31 +00:00
ElementBot aa4125bdc0 Sync Strings from Localazy (#5994)
Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>
2026-01-14 11:43:57 +00:00
Benoit Marty 8a290c339d Make the notification silent when the message is an outgoing message (quick reply). (#5961)
The boolean isUpdated will be passed to setOnlyAlertOnce(), and when the value is true, the notification does not ring/vibrate again.
2026-01-05 18:13:17 +01:00
ElementBot 46f6e811d5 Sync Strings from Localazy (#5971)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-01-05 13:57:09 +01:00
Benoit Marty 7576a978e0 Make the notification silent when the message is an outgoing message (quick reply).
The boolean isUpdated will be passed to setOnlyAlertOnce(), and when the value is true, the notification does not ring/vibrate again.
2025-12-30 16:47:38 +01:00
bmarty 96dc67162c Sync Strings from Localazy 2025-12-23 11:23:46 +01:00
ElementBot ad881c303a Sync Strings from Localazy (#5904)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-12-15 23:51:19 +01:00
Jorge Martín 734485255a Add a periodic DB vacuuming task 2025-12-10 15:22:16 +01:00
Benoit Marty f76d817b4e Merge pull request #5852 from element-hq/renovate/io.nlopez.compose.rules-detekt-0.x
fix(deps): update dependency io.nlopez.compose.rules:detekt to v0.5.1
2025-12-08 15:05:12 +01:00
bmarty 3935a3b6ce Sync Strings from Localazy 2025-12-08 00:34:18 +00:00
Jorge Martín 9c7ba58114 Don't re-schedule notification fetches if the cause of the failure is SessionRestorationException, since that means it'll most likely fail again 2025-12-05 17:42:57 +01:00
Benoit Marty 54e742075d Detekt: enable rule exceptions.SwallowedException and fix existing issue. 2025-12-05 09:45:23 +01:00
ganfra 236db9e35d change(notification): handle invite notification for spaces 2025-12-04 12:25:30 +01:00
Benoit Marty 63f7c9a4fd Iterate on Save change dialog. 2025-12-03 18:04:53 +01:00
bmarty 32d56ea92d Sync Strings from Localazy 2025-12-01 00:23:54 +00:00