From 9420d309a5721d90d2a2ce7f4804aa9db3ceb822 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 5 May 2022 10:38:49 +0200 Subject: [PATCH 1/5] Add changes --- CHANGES.md | 55 +++++++++++++++++++ changelog.d/5421.bugfix | 1 - changelog.d/5575.sdk | 2 - changelog.d/5592.bugfix | 1 - changelog.d/5652.bugfix | 1 - changelog.d/5721.bugfix | 1 - changelog.d/5772.feature | 1 - changelog.d/5773.misc | 1 - changelog.d/5774.misc | 1 - changelog.d/5783.wip | 1 - changelog.d/5805.misc | 1 - changelog.d/5811.feature | 1 - changelog.d/5812.sdk | 1 - changelog.d/5814.feature | 1 - changelog.d/5816.sdk | 2 - changelog.d/5826.bugfix | 1 - changelog.d/5832.misc | 1 - changelog.d/5836.doc | 1 - changelog.d/5847.bugfix | 1 - changelog.d/5854.doc | 1 - changelog.d/5855.sdk | 1 - changelog.d/5858.sdk | 1 - changelog.d/5862.wip | 1 - changelog.d/5871.bugfix | 1 - changelog.d/5872.misc | 1 - changelog.d/5874.bugfix | 1 - changelog.d/5885.bugfix | 1 - changelog.d/5886.bugfix | 1 - changelog.d/5890.sdk | 1 - changelog.d/5907.sdk | 1 - changelog.d/5924.bugfix | 1 - changelog.d/5925.bugfix | 1 - .../android/en-US/changelogs/40104140.txt | 2 + 33 files changed, 57 insertions(+), 33 deletions(-) delete mode 100644 changelog.d/5421.bugfix delete mode 100644 changelog.d/5575.sdk delete mode 100644 changelog.d/5592.bugfix delete mode 100644 changelog.d/5652.bugfix delete mode 100644 changelog.d/5721.bugfix delete mode 100644 changelog.d/5772.feature delete mode 100644 changelog.d/5773.misc delete mode 100644 changelog.d/5774.misc delete mode 100644 changelog.d/5783.wip delete mode 100644 changelog.d/5805.misc delete mode 100644 changelog.d/5811.feature delete mode 100644 changelog.d/5812.sdk delete mode 100644 changelog.d/5814.feature delete mode 100644 changelog.d/5816.sdk delete mode 100644 changelog.d/5826.bugfix delete mode 100644 changelog.d/5832.misc delete mode 100644 changelog.d/5836.doc delete mode 100644 changelog.d/5847.bugfix delete mode 100644 changelog.d/5854.doc delete mode 100644 changelog.d/5855.sdk delete mode 100644 changelog.d/5858.sdk delete mode 100644 changelog.d/5862.wip delete mode 100644 changelog.d/5871.bugfix delete mode 100644 changelog.d/5872.misc delete mode 100644 changelog.d/5874.bugfix delete mode 100644 changelog.d/5885.bugfix delete mode 100644 changelog.d/5886.bugfix delete mode 100644 changelog.d/5890.sdk delete mode 100644 changelog.d/5907.sdk delete mode 100644 changelog.d/5924.bugfix delete mode 100644 changelog.d/5925.bugfix create mode 100644 fastlane/metadata/android/en-US/changelogs/40104140.txt diff --git a/CHANGES.md b/CHANGES.md index f952ec952a..8e42149545 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,58 @@ +Changes in Element v1.4.14 (2022-05-05) +======================================= + +Features ✨ +---------- + - Improve management of ignored users ([#5772](https://github.com/vector-im/element-android/issues/5772)) + - VoIP Screen Sharing Permission ([#5811](https://github.com/vector-im/element-android/issues/5811)) + - Live location sharing: updating beacon state event content structure ([#5814](https://github.com/vector-im/element-android/issues/5814)) + +Bugfixes 🐛 +---------- + - Fixes crash when accepting or receiving VOIP calls ([#5421](https://github.com/vector-im/element-android/issues/5421)) + - Improve/fix crashes on messages decryption ([#5592](https://github.com/vector-im/element-android/issues/5592)) + - Tentative fix of images crashing when being sent or shared from gallery ([#5652](https://github.com/vector-im/element-android/issues/5652)) + - Improving deactivation experience along with a crash fix ([#5721](https://github.com/vector-im/element-android/issues/5721)) + - Adds missing suggested tag for rooms in Explore Space ([#5826](https://github.com/vector-im/element-android/issues/5826)) + - Fixes missing call icons when threads are enabled ([#5847](https://github.com/vector-im/element-android/issues/5847)) + - Fix UX freezing when creating secure backup ([#5871](https://github.com/vector-im/element-android/issues/5871)) + - Fixes sign in via other requiring homeserver registration to be enabled ([#5874](https://github.com/vector-im/element-android/issues/5874)) + - Don't pause timer when call is held. ([#5885](https://github.com/vector-im/element-android/issues/5885)) + - Fix UISIDetector grace period bug ([#5886](https://github.com/vector-im/element-android/issues/5886)) + - Fix a crash with space invitations in the space list, and do not display space invitation twice. ([#5924](https://github.com/vector-im/element-android/issues/5924)) + - Fixes crash on android api 21/22 devices when opening messages due to Konfetti library ([#5925](https://github.com/vector-im/element-android/issues/5925)) + +In development 🚧 +---------------- + - Reorders the registration steps to prioritise email, then terms for the FTUE onboarding ([#5783](https://github.com/vector-im/element-android/issues/5783)) + - [Live location sharing] Improve aggregation process of events ([#5862](https://github.com/vector-im/element-android/issues/5862)) + +Improved Documentation 📚 +------------------------ + - Update the PR process doc with 2 reviewers and a new reviewer team. ([#5836](https://github.com/vector-im/element-android/issues/5836)) + - Improve documentation of the project and of the SDK ([#5854](https://github.com/vector-im/element-android/issues/5854)) + +SDK API changes ⚠️ +------------------ + - Added registrationCustom into RegistrationWizard to send custom auth params for sign up + - Moved terms converter into api package to make it accessible in sdk ([#5575](https://github.com/vector-im/element-android/issues/5575)) + - Move package `org.matrix.android.sdk.api.pushrules` to `org.matrix.android.sdk.api.session.pushrules` ([#5812](https://github.com/vector-im/element-android/issues/5812)) + - Some `Session` apis are now available by requesting the service first. For instance `Session.updateAvatar(...)` is now `Session.profileService().updateAvatar(...)` + - The shortcut `Room.search()` has been removed, you have to use `Session.searchService().search()` ([#5816](https://github.com/vector-im/element-android/issues/5816)) + - Add return type to RoomApi.sendStateEvent() to retrieve the created event id ([#5855](https://github.com/vector-im/element-android/issues/5855)) + - `Room` apis are now available by requesting the service first. For instance `Room.updateAvatar(...)` is now `Room.stateService().updateAvatar(...)` ([#5858](https://github.com/vector-im/element-android/issues/5858)) + - Remove unecessary field `eventId` from `EventAnnotationsSummary` and `ReferencesAggregatedSummary` ([#5890](https://github.com/vector-im/element-android/issues/5890)) + - Replace usage of `System.currentTimeMillis()` by a `Clock` interface ([#5907](https://github.com/vector-im/element-android/issues/5907)) + +Other changes +------------- + - Move "Ignored users" setting section into "Security & Privacy" ([#5773](https://github.com/vector-im/element-android/issues/5773)) + - Add a picto for ignored users in the room member list screen ([#5774](https://github.com/vector-im/element-android/issues/5774)) + - Autoformats entire project ([#5805](https://github.com/vector-im/element-android/issues/5805)) + - Add a GH workflow to push ElementX issues to the global board. ([#5832](https://github.com/vector-im/element-android/issues/5832)) + - Faster Olm decrypt when there is a lot of existing sessions ([#5872](https://github.com/vector-im/element-android/issues/5872)) + + Changes in Element 1.4.13 (2022-04-26) ====================================== diff --git a/changelog.d/5421.bugfix b/changelog.d/5421.bugfix deleted file mode 100644 index 2f9a1c0b1c..0000000000 --- a/changelog.d/5421.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes crash when accepting or receiving VOIP calls diff --git a/changelog.d/5575.sdk b/changelog.d/5575.sdk deleted file mode 100644 index 19339bdce2..0000000000 --- a/changelog.d/5575.sdk +++ /dev/null @@ -1,2 +0,0 @@ -- Added registrationCustom into RegistrationWizard to send custom auth params for sign up -- Moved terms converter into api package to make it accessible in sdk \ No newline at end of file diff --git a/changelog.d/5592.bugfix b/changelog.d/5592.bugfix deleted file mode 100644 index f0df3dc646..0000000000 --- a/changelog.d/5592.bugfix +++ /dev/null @@ -1 +0,0 @@ -Improve/fix crashes on messages decryption diff --git a/changelog.d/5652.bugfix b/changelog.d/5652.bugfix deleted file mode 100644 index 8ebea1558f..0000000000 --- a/changelog.d/5652.bugfix +++ /dev/null @@ -1 +0,0 @@ -Tentative fix of images crashing when being sent or shared from gallery diff --git a/changelog.d/5721.bugfix b/changelog.d/5721.bugfix deleted file mode 100644 index 8b752b43a9..0000000000 --- a/changelog.d/5721.bugfix +++ /dev/null @@ -1 +0,0 @@ -Improving deactivation experience along with a crash fix \ No newline at end of file diff --git a/changelog.d/5772.feature b/changelog.d/5772.feature deleted file mode 100644 index 85eec0a1ad..0000000000 --- a/changelog.d/5772.feature +++ /dev/null @@ -1 +0,0 @@ -Improve management of ignored users \ No newline at end of file diff --git a/changelog.d/5773.misc b/changelog.d/5773.misc deleted file mode 100644 index 39c8b42073..0000000000 --- a/changelog.d/5773.misc +++ /dev/null @@ -1 +0,0 @@ -Move "Ignored users" setting section into "Security & Privacy" \ No newline at end of file diff --git a/changelog.d/5774.misc b/changelog.d/5774.misc deleted file mode 100644 index 795106381b..0000000000 --- a/changelog.d/5774.misc +++ /dev/null @@ -1 +0,0 @@ -Add a picto for ignored users in the room member list screen \ No newline at end of file diff --git a/changelog.d/5783.wip b/changelog.d/5783.wip deleted file mode 100644 index e306c0f217..0000000000 --- a/changelog.d/5783.wip +++ /dev/null @@ -1 +0,0 @@ -Reorders the registration steps to prioritise email, then terms for the FTUE onboarding diff --git a/changelog.d/5805.misc b/changelog.d/5805.misc deleted file mode 100644 index e0e6a311b4..0000000000 --- a/changelog.d/5805.misc +++ /dev/null @@ -1 +0,0 @@ -Autoformats entire project diff --git a/changelog.d/5811.feature b/changelog.d/5811.feature deleted file mode 100644 index 12111e323b..0000000000 --- a/changelog.d/5811.feature +++ /dev/null @@ -1 +0,0 @@ -VoIP Screen Sharing Permission \ No newline at end of file diff --git a/changelog.d/5812.sdk b/changelog.d/5812.sdk deleted file mode 100644 index 5ddd8cfac1..0000000000 --- a/changelog.d/5812.sdk +++ /dev/null @@ -1 +0,0 @@ -Move package `org.matrix.android.sdk.api.pushrules` to `org.matrix.android.sdk.api.session.pushrules` diff --git a/changelog.d/5814.feature b/changelog.d/5814.feature deleted file mode 100644 index c892702486..0000000000 --- a/changelog.d/5814.feature +++ /dev/null @@ -1 +0,0 @@ -Live location sharing: updating beacon state event content structure diff --git a/changelog.d/5816.sdk b/changelog.d/5816.sdk deleted file mode 100644 index 17233c66e5..0000000000 --- a/changelog.d/5816.sdk +++ /dev/null @@ -1,2 +0,0 @@ -Some `Session` apis are now available by requesting the service first. For instance `Session.updateAvatar(...)` is now `Session.profileService().updateAvatar(...)` -The shortcut `Room.search()` has been removed, you have to use `Session.searchService().search()` diff --git a/changelog.d/5826.bugfix b/changelog.d/5826.bugfix deleted file mode 100644 index 2735568f73..0000000000 --- a/changelog.d/5826.bugfix +++ /dev/null @@ -1 +0,0 @@ -Adds missing suggested tag for rooms in Explore Space diff --git a/changelog.d/5832.misc b/changelog.d/5832.misc deleted file mode 100644 index ace9dff5d4..0000000000 --- a/changelog.d/5832.misc +++ /dev/null @@ -1 +0,0 @@ -Add a GH workflow to push ElementX issues to the global board. \ No newline at end of file diff --git a/changelog.d/5836.doc b/changelog.d/5836.doc deleted file mode 100644 index 42073d66ef..0000000000 --- a/changelog.d/5836.doc +++ /dev/null @@ -1 +0,0 @@ -Update the PR process doc with 2 reviewers and a new reviewer team. \ No newline at end of file diff --git a/changelog.d/5847.bugfix b/changelog.d/5847.bugfix deleted file mode 100644 index acd13dec9a..0000000000 --- a/changelog.d/5847.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes missing call icons when threads are enabled diff --git a/changelog.d/5854.doc b/changelog.d/5854.doc deleted file mode 100644 index 38a1c756af..0000000000 --- a/changelog.d/5854.doc +++ /dev/null @@ -1 +0,0 @@ -Improve documentation of the project and of the SDK diff --git a/changelog.d/5855.sdk b/changelog.d/5855.sdk deleted file mode 100644 index bad5a11398..0000000000 --- a/changelog.d/5855.sdk +++ /dev/null @@ -1 +0,0 @@ -- Add return type to RoomApi.sendStateEvent() to retrieve the created event id diff --git a/changelog.d/5858.sdk b/changelog.d/5858.sdk deleted file mode 100644 index 9f2e7ef0f2..0000000000 --- a/changelog.d/5858.sdk +++ /dev/null @@ -1 +0,0 @@ -`Room` apis are now available by requesting the service first. For instance `Room.updateAvatar(...)` is now `Room.stateService().updateAvatar(...)` diff --git a/changelog.d/5862.wip b/changelog.d/5862.wip deleted file mode 100644 index 303a054c5e..0000000000 --- a/changelog.d/5862.wip +++ /dev/null @@ -1 +0,0 @@ -[Live location sharing] Improve aggregation process of events diff --git a/changelog.d/5871.bugfix b/changelog.d/5871.bugfix deleted file mode 100644 index b223ddd141..0000000000 --- a/changelog.d/5871.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix UX freezing when creating secure backup diff --git a/changelog.d/5872.misc b/changelog.d/5872.misc deleted file mode 100644 index 1e15229800..0000000000 --- a/changelog.d/5872.misc +++ /dev/null @@ -1 +0,0 @@ -Faster Olm decrypt when there is a lot of existing sessions diff --git a/changelog.d/5874.bugfix b/changelog.d/5874.bugfix deleted file mode 100644 index a0f700bed5..0000000000 --- a/changelog.d/5874.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes sign in via other requiring homeserver registration to be enabled diff --git a/changelog.d/5885.bugfix b/changelog.d/5885.bugfix deleted file mode 100644 index a555ad0e98..0000000000 --- a/changelog.d/5885.bugfix +++ /dev/null @@ -1 +0,0 @@ -Don't pause timer when call is held. diff --git a/changelog.d/5886.bugfix b/changelog.d/5886.bugfix deleted file mode 100644 index c4239e5c3a..0000000000 --- a/changelog.d/5886.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix UISIDetector grace period bug diff --git a/changelog.d/5890.sdk b/changelog.d/5890.sdk deleted file mode 100644 index 0d5e8d783d..0000000000 --- a/changelog.d/5890.sdk +++ /dev/null @@ -1 +0,0 @@ -Remove unecessary field `eventId` from `EventAnnotationsSummary` and `ReferencesAggregatedSummary` diff --git a/changelog.d/5907.sdk b/changelog.d/5907.sdk deleted file mode 100644 index 623cc2a174..0000000000 --- a/changelog.d/5907.sdk +++ /dev/null @@ -1 +0,0 @@ -Replace usage of `System.currentTimeMillis()` by a `Clock` interface diff --git a/changelog.d/5924.bugfix b/changelog.d/5924.bugfix deleted file mode 100644 index 8a159211fe..0000000000 --- a/changelog.d/5924.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix a crash with space invitations in the space list, and do not display space invitation twice. diff --git a/changelog.d/5925.bugfix b/changelog.d/5925.bugfix deleted file mode 100644 index eff0c17a5c..0000000000 --- a/changelog.d/5925.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes crash on android api 21/22 devices when opening messages due to Konfetti library diff --git a/fastlane/metadata/android/en-US/changelogs/40104140.txt b/fastlane/metadata/android/en-US/changelogs/40104140.txt new file mode 100644 index 0000000000..5cbd25f4d3 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40104140.txt @@ -0,0 +1,2 @@ +Main changes in this version: Improve management of ignored users. Various bug fixes and stability improvements. +Full changelog: https://github.com/vector-im/element-android/releases From 83f8a8f278541b10f525efa0b20ec1289fb94058 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 5 May 2022 11:34:12 +0200 Subject: [PATCH 2/5] Bump version to 1.4.16 --- matrix-sdk-android/build.gradle | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 2aab8510ce..c57c09e3c7 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -53,7 +53,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.4.14\"" + buildConfigField "String", "SDK_VERSION", "\"1.4.16\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" diff --git a/vector/build.gradle b/vector/build.gradle index 162d9fe81c..e4152fae68 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -18,7 +18,7 @@ ext.versionMinor = 4 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. -ext.versionPatch = 14 +ext.versionPatch = 16 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From c9bd1f32b90527b8af3c614663612a500d664390 Mon Sep 17 00:00:00 2001 From: ClaireG Date: Thu, 5 May 2022 14:02:11 +0200 Subject: [PATCH 3/5] Update notifications rules: make a sound for each notification --- changelog.d/46312.misc | 1 + .../app/features/notifications/InviteNotifiableEvent.kt | 3 ++- .../vector/app/features/notifications/NotifiableEvent.kt | 1 + .../app/features/notifications/NotifiableMessageEvent.kt | 3 ++- .../app/features/notifications/NotificationEventQueue.kt | 8 +++++++- .../app/features/notifications/NotificationUtils.kt | 2 +- .../app/features/notifications/RoomEventGroupInfo.kt | 1 + .../app/features/notifications/RoomGroupMessageCreator.kt | 1 + .../app/features/notifications/SimpleNotifiableEvent.kt | 3 ++- .../features/notifications/NotificationEventQueueTest.kt | 6 +++--- 10 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 changelog.d/46312.misc diff --git a/changelog.d/46312.misc b/changelog.d/46312.misc new file mode 100644 index 0000000000..5e0112372f --- /dev/null +++ b/changelog.d/46312.misc @@ -0,0 +1 @@ +Notify the user for each new message diff --git a/vector/src/main/java/im/vector/app/features/notifications/InviteNotifiableEvent.kt b/vector/src/main/java/im/vector/app/features/notifications/InviteNotifiableEvent.kt index 832f97bc4e..eb0735f2be 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/InviteNotifiableEvent.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/InviteNotifiableEvent.kt @@ -28,5 +28,6 @@ data class InviteNotifiableEvent( val type: String?, val timestamp: Long, val soundName: String?, - override val isRedacted: Boolean = false + override val isRedacted: Boolean = false, + override val isUpdated: Boolean = false ) : NotifiableEvent diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEvent.kt b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEvent.kt index 52d8119cbb..a9ad79febf 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEvent.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEvent.kt @@ -27,4 +27,5 @@ sealed interface NotifiableEvent : Serializable { // Used to know if event should be replaced with the one coming from eventstream val canBeReplaced: Boolean val isRedacted: Boolean + val isUpdated: Boolean } diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotifiableMessageEvent.kt b/vector/src/main/java/im/vector/app/features/notifications/NotifiableMessageEvent.kt index 35718666b0..d13e41daa8 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotifiableMessageEvent.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotifiableMessageEvent.kt @@ -38,7 +38,8 @@ data class NotifiableMessageEvent( // This is used for >N notification, as the result of a smart reply val outGoingMessage: Boolean = false, val outGoingMessageFailed: Boolean = false, - override val isRedacted: Boolean = false + override val isRedacted: Boolean = false, + override val isUpdated: Boolean = false ) : NotifiableEvent { val type: String = EventType.MESSAGE diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationEventQueue.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationEventQueue.kt index 04506b218b..7c933c389d 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationEventQueue.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationEventQueue.kt @@ -112,7 +112,13 @@ data class NotificationEventQueue( private fun replace(replace: NotifiableEvent, with: NotifiableEvent) { queue.remove(replace) - queue.add(with) + queue.add( + when (with) { + is InviteNotifiableEvent -> with.copy(isUpdated = true) + is NotifiableMessageEvent -> with.copy(isUpdated = true) + is SimpleNotifiableEvent -> with.copy(isUpdated = true) + } + ) } fun clearMemberShipNotificationForRoom(roomId: String) { diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt index 08f6ccc2f3..b480253636 100755 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt @@ -592,7 +592,7 @@ class NotificationUtils @Inject constructor( val channelID = if (roomInfo.shouldBing) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID return NotificationCompat.Builder(context, channelID) - .setOnlyAlertOnce(true) + .setOnlyAlertOnce(roomInfo.isUpdated) .setWhen(lastMessageTimestamp) // MESSAGING_STYLE sets title and content for API 16 and above devices. .setStyle(messageStyle) diff --git a/vector/src/main/java/im/vector/app/features/notifications/RoomEventGroupInfo.kt b/vector/src/main/java/im/vector/app/features/notifications/RoomEventGroupInfo.kt index 64e40ed748..6ec4645382 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/RoomEventGroupInfo.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/RoomEventGroupInfo.kt @@ -31,4 +31,5 @@ data class RoomEventGroupInfo( var shouldBing: Boolean = false var customSound: String? = null var hasSmartReplyError: Boolean = false + var isUpdated: Boolean = false } diff --git a/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt b/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt index 8310c15daa..535ac8b62e 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt @@ -72,6 +72,7 @@ class RoomGroupMessageCreator @Inject constructor( it.hasSmartReplyError = smartReplyErrors.isNotEmpty() it.shouldBing = meta.shouldBing it.customSound = events.last().soundName + it.isUpdated = events.last().isUpdated }, largeIcon = largeBitmap, lastMessageTimestamp, diff --git a/vector/src/main/java/im/vector/app/features/notifications/SimpleNotifiableEvent.kt b/vector/src/main/java/im/vector/app/features/notifications/SimpleNotifiableEvent.kt index 8c72372204..a58f22087d 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/SimpleNotifiableEvent.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/SimpleNotifiableEvent.kt @@ -26,5 +26,6 @@ data class SimpleNotifiableEvent( val timestamp: Long, val soundName: String?, override var canBeReplaced: Boolean, - override val isRedacted: Boolean = false + override val isRedacted: Boolean = false, + override val isUpdated: Boolean = false ) : NotifiableEvent diff --git a/vector/src/test/java/im/vector/app/features/notifications/NotificationEventQueueTest.kt b/vector/src/test/java/im/vector/app/features/notifications/NotificationEventQueueTest.kt index 3429f882f8..e7349b6151 100644 --- a/vector/src/test/java/im/vector/app/features/notifications/NotificationEventQueueTest.kt +++ b/vector/src/test/java/im/vector/app/features/notifications/NotificationEventQueueTest.kt @@ -145,7 +145,7 @@ class NotificationEventQueueTest { @Test fun `given replaceable event when adding event with same id then updates existing event`() { val replaceableEvent = aSimpleNotifiableEvent(canBeReplaced = true) - val updatedEvent = replaceableEvent.copy(title = "updated title") + val updatedEvent = replaceableEvent.copy(title = "updated title", isUpdated = true) val queue = givenQueue(listOf(replaceableEvent)) queue.add(updatedEvent) @@ -167,7 +167,7 @@ class NotificationEventQueueTest { @Test fun `given event when adding new event with edited event id matching the existing event id then updates existing event`() { val editedEvent = aSimpleNotifiableEvent(eventId = "id-to-edit") - val updatedEvent = editedEvent.copy(eventId = "1", editedEventId = "id-to-edit", title = "updated title") + val updatedEvent = editedEvent.copy(eventId = "1", editedEventId = "id-to-edit", title = "updated title", isUpdated = true) val queue = givenQueue(listOf(editedEvent)) queue.add(updatedEvent) @@ -178,7 +178,7 @@ class NotificationEventQueueTest { @Test fun `given event when adding new event with edited event id matching the existing event edited id then updates existing event`() { val editedEvent = aSimpleNotifiableEvent(eventId = "0", editedEventId = "id-to-edit") - val updatedEvent = editedEvent.copy(eventId = "1", editedEventId = "id-to-edit", title = "updated title") + val updatedEvent = editedEvent.copy(eventId = "1", editedEventId = "id-to-edit", title = "updated title", isUpdated = true) val queue = givenQueue(listOf(editedEvent)) queue.add(updatedEvent) From 94f15d109a243ed85beeebfed57dcfc0d0ec1472 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 5 May 2022 16:20:08 +0100 Subject: [PATCH 4/5] fixing crash on launch - due to missing primary key migration in the live location --- .../database/RealmSessionStoreMigration.kt | 4 ++- .../database/migration/MigrateSessionTo028.kt | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt index 24ac310653..04a6e83ea1 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt @@ -45,6 +45,7 @@ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo024 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo025 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo026 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo027 +import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo028 import org.matrix.android.sdk.internal.util.Normalizer import timber.log.Timber import javax.inject.Inject @@ -59,7 +60,7 @@ internal class RealmSessionStoreMigration @Inject constructor( override fun equals(other: Any?) = other is RealmSessionStoreMigration override fun hashCode() = 1000 - val schemaVersion = 27L + val schemaVersion = 28L override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) { Timber.d("Migrating Realm Session from $oldVersion to $newVersion") @@ -91,5 +92,6 @@ internal class RealmSessionStoreMigration @Inject constructor( if (oldVersion < 25) MigrateSessionTo025(realm).perform() if (oldVersion < 26) MigrateSessionTo026(realm).perform() if (oldVersion < 27) MigrateSessionTo027(realm).perform() + if (oldVersion < 28) MigrateSessionTo028(realm).perform() } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt new file mode 100644 index 0000000000..1d0c638d7b --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The Matrix.org Foundation C.I.C. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.matrix.android.sdk.internal.database.migration + +import io.realm.DynamicRealm +import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationShareAggregatedSummaryEntityFields +import org.matrix.android.sdk.internal.util.database.RealmMigrator + +/** + * Migrating to: + * Live location sharing aggregated summary + */ +internal class MigrateSessionTo028(realm: DynamicRealm) : RealmMigrator(realm, 28) { + + override fun doMigrate(realm: DynamicRealm) { + realm.schema.get("LiveLocationShareAggregatedSummaryEntity") + ?.takeIf { !it.hasPrimaryKey() } + ?.addPrimaryKey(LiveLocationShareAggregatedSummaryEntityFields.EVENT_ID) + } +} From 0683085398be2efeff3a485861b374644865d432 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 5 May 2022 16:20:08 +0100 Subject: [PATCH 5/5] fixing crash on launch - due to missing primary key migration in the live location --- .../database/RealmSessionStoreMigration.kt | 4 ++- .../database/migration/MigrateSessionTo028.kt | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt index 24ac310653..04a6e83ea1 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt @@ -45,6 +45,7 @@ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo024 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo025 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo026 import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo027 +import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo028 import org.matrix.android.sdk.internal.util.Normalizer import timber.log.Timber import javax.inject.Inject @@ -59,7 +60,7 @@ internal class RealmSessionStoreMigration @Inject constructor( override fun equals(other: Any?) = other is RealmSessionStoreMigration override fun hashCode() = 1000 - val schemaVersion = 27L + val schemaVersion = 28L override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) { Timber.d("Migrating Realm Session from $oldVersion to $newVersion") @@ -91,5 +92,6 @@ internal class RealmSessionStoreMigration @Inject constructor( if (oldVersion < 25) MigrateSessionTo025(realm).perform() if (oldVersion < 26) MigrateSessionTo026(realm).perform() if (oldVersion < 27) MigrateSessionTo027(realm).perform() + if (oldVersion < 28) MigrateSessionTo028(realm).perform() } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt new file mode 100644 index 0000000000..1d0c638d7b --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo028.kt @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The Matrix.org Foundation C.I.C. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.matrix.android.sdk.internal.database.migration + +import io.realm.DynamicRealm +import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationShareAggregatedSummaryEntityFields +import org.matrix.android.sdk.internal.util.database.RealmMigrator + +/** + * Migrating to: + * Live location sharing aggregated summary + */ +internal class MigrateSessionTo028(realm: DynamicRealm) : RealmMigrator(realm, 28) { + + override fun doMigrate(realm: DynamicRealm) { + realm.schema.get("LiveLocationShareAggregatedSummaryEntity") + ?.takeIf { !it.hasPrimaryKey() } + ?.addPrimaryKey(LiveLocationShareAggregatedSummaryEntityFields.EVENT_ID) + } +}