Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to changes in SDK #2836

Merged
merged 7 commits into from
May 13, 2024
Merged

Adapt to changes in SDK #2836

merged 7 commits into from
May 13, 2024

Conversation

jmartinesp
Copy link
Member

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Changes to generate the new app version:

  • Bump version to 0.4.12 so we can replace the existing one in the store due to CVE-2024-34353 / GHSA-9ggc-845v-gcgv.
  • Add migration to remove existing logs, based on AppMigration01.
  • Bump SDK version to 0.2.18, which contains a security fix.
  • Lots of changes to to integrate the new SDK version:
    • Remove name from MatrixRoom, we should use displayName instead.
    • Remove separate invites room list.
    • Added runBlocking to get the now async NotificationClient from the Rust SDK.
    • Made some other functions suspend.
    • Client.resolveRoomAlias now returns a roomId and via parameters, we pass the roomId.

Motivation and context

New release.

Tests

You can test the general use of the app.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

- Remove `name` from `MatrixRoom`, we should use `displayName` instead.
- Remove separate `invites` room list.
@jmartinesp jmartinesp requested a review from a team as a code owner May 13, 2024 13:38
@jmartinesp jmartinesp requested review from bmarty and removed request for a team May 13, 2024 13:38
@ElementBot
Copy link
Collaborator

ElementBot commented May 13, 2024

Warnings
⚠️

Please add a changelog. See instructions here

Messages
📖 Sign-off not required, allow-list

Generated by 🚫 dangerJS against 4332159

Copy link
Contributor

github-actions bot commented May 13, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/U8jzdV

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.95%. Comparing base (d0923f2) to head (59d9069).

❗ Current head 59d9069 differs from pull request most recent head 4332159. Consider uploading reports for the commit 4332159 to get more accurate results

Files Patch % Lines
...atures/migration/impl/migrations/AppMigration03.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2836      +/-   ##
===========================================
- Coverage    73.95%   73.95%   -0.01%     
===========================================
  Files         1530     1531       +1     
  Lines        36541    36535       -6     
  Branches      7074     7074              
===========================================
- Hits         27025    27020       -5     
- Misses        5811     5812       +1     
+ Partials      3705     3703       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Technically it's the same as `AppMigration01`.
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no blocking remarks, thanks!

private val logFilesRemover: LogFilesRemover,
) : AppMigration01(logFilesRemover) {
override val order: Int = 3
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK, but maybe it will be clearer using composition.

What do you think about:

@ContributesMultibinding(AppScope::class)
class AppMigration03 @Inject constructor(
    private val appMigration01: AppMigration01,
) : AppMigration {
    override val order: Int = 3

    override suspend fun migrate() {
        appMigration01.migrate()
    }
}

Consequently, AppMigration01 does not need to be open

@@ -65,7 +65,7 @@ class RoomDetailsEditPresenter @Inject constructor(
// just erase the local value when the room field has changed
var roomAvatarUri by rememberSaveable(room.avatarUrl) { mutableStateOf(room.avatarUrl?.toUri()) }

var roomName by rememberSaveable { mutableStateOf((room.name ?: room.displayName).trim()) }
var roomName by rememberSaveable { mutableStateOf(room.displayName.trim()) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use the new field RoomInfo.rawName here, but this can be handled separately.

It will fix the form per-filled with a computed room name like "Alice, Bob and 3 others".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using RoomInfo.rawName needs some other changes so I think it's probably better to do it on a separate PR.

*
* To apply some dynamic filtering on top of that, use [DynamicRoomList].
*/
enum class Source {
All,
Invites,
All
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is becoming a bit useless if there is only one value, but I think we could keep this enum for clarity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wanted to keep it in case we'd need separate lists in the future again for some reason.

@@ -465,7 +461,7 @@ class RustMatrixClient(

override suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<RoomId> = withContext(sessionDispatcher) {
runCatching {
client.resolveRoomAlias(roomAlias.value).let(::RoomId)
client.resolveRoomAlias(roomAlias.value).roomId.let(::RoomId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will improve this and use the returned servers list in a separate PR.

private val notificationClient = client.notificationClient(notificationProcessSetup)
.use { builder ->
builder
.filterByPushRules()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API has vanished, I guess this is OK

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 13, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 13, 2024
@jmartinesp jmartinesp enabled auto-merge (squash) May 13, 2024 14:22
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jmartinesp jmartinesp disabled auto-merge May 13, 2024 14:34
@jmartinesp jmartinesp merged commit f2f96e0 into develop May 13, 2024
13 of 14 checks passed
@jmartinesp jmartinesp deleted the version-0.4.12 branch May 13, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants