Commit Graph

647 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
721add707c 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]
7c97ec1155 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
1f69958dab 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
66c3bf267a 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
5bcaad1e81 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
b3b22033aa Handle EventRedacted case. Fixes #5569 2026-03-02 09:15:53 +01:00
Jorge Martín
cdd850d4dd 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]
89a6f5a7bf 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
fe4554703c 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
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
bmarty
6c81e88689 Sync Strings from Localazy 2026-02-23 00:39:49 +00:00
Benoit Marty
d2ca80e7e8 Fix compilation issue after merging develop. 2026-02-13 16:44:42 +01:00
Benoit Marty
c1f3233dce Merge branch 'develop' into feature/bma/notificationCustomSound 2026-02-13 15:48:19 +01:00
Benoit Marty
0233f4dde4 Add name parameters 2026-02-12 17:57:52 +01:00
Benoit Marty
88a104a6d4 Swap receiver and parameter for a nicer code. 2026-02-12 17:57:31 +01:00
Benoit Marty
130ff40e5c Fix typo 2026-02-12 14:42:58 +01:00
Benoit Marty
48fae51ef0 Ignore fallback notification when the room list is rendered.
Add more tests.
2026-02-12 13:30:46 +01:00
Benoit Marty
a651a1cd6f Improve FakeAppNavigationStateService 2026-02-12 13:30:06 +01:00
Benoit Marty
00fb4498f4 Dismiss fallback notification when the room list is rendered. 2026-02-12 13:26:53 +01:00
Benoit Marty
b9d5645853 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
ff4455b0ce Fix test. 2026-02-12 09:12:17 +01:00
Benoit Marty
44cab62fc3 Merge branch 'develop' into feature/bma/notificationFallbackCounter 2026-02-11 21:10:14 +01:00
Benoit Marty
9fbb21fb39 Add missing test 2026-02-11 21:06:19 +01:00
Benoit Marty
843e1a28b2 Cleanup 2026-02-11 20:51:05 +01:00
Benoit Marty
83fee6d9ba Remove NavigationState.Space.
We do not have the concept of current space.
2026-02-11 20:41:55 +01:00
Benoit Marty
e3ace3c87e Rely on the SessionObserver to detect a sign out. 2026-02-11 18:06:32 +01:00
Benoit Marty
4234600d06 Notification: implement a counter in the fallback notification. 2026-02-11 16:43:03 +01:00
Benoit Marty
71fef289d1 Cleanup: remove unused summaryLine field. 2026-02-11 15:36:12 +01:00
Benoit Marty
6e958f3132 Let enterprise build be able to use a different notification channel for noisy notification. 2026-02-11 11:57:01 +01:00
Benoit Marty
7535258bae 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
21595b2155 Format file. 2026-02-10 17:40:20 +01:00
ElementBot
6a101e7b65 Sync Strings from Localazy (#6155)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-02-09 16:30:57 +01:00
ElementBot
b731d9a4a3 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
deb340daba 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
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
bmarty
5a8ce6d68c Sync Strings from Localazy 2026-01-19 00:35:31 +00:00
ElementBot
d01a511903 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
ec43d7652b 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
860390beb0 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
d524cd4a74 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
a2ca2e7c1f Sync Strings from Localazy 2025-12-23 11:23:46 +01:00
ElementBot
6880cf518c 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
482d7e0648 Add a periodic DB vacuuming task 2025-12-10 15:22:16 +01:00
Benoit Marty
4cfd8907dd 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
f4c8bbd8ad Sync Strings from Localazy 2025-12-08 00:34:18 +00:00
Jorge Martín
754c0781f9 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
72b3decf4c Detekt: enable rule exceptions.SwallowedException and fix existing issue. 2025-12-05 09:45:23 +01:00
ganfra
a27e31b01b change(notification): handle invite notification for spaces 2025-12-04 12:25:30 +01:00
Benoit Marty
eeef1b11ea Iterate on Save change dialog. 2025-12-03 18:04:53 +01:00
bmarty
2b49c40592 Sync Strings from Localazy 2025-12-01 00:23:54 +00:00