-
Notifications
You must be signed in to change notification settings - Fork 907
Replace flattenParents with directParentName #6314
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
Changes from 5 commits
385720b
d5c5c57
d40c2f8
7f3325e
b5fc0b5
9766b62
9350053
cb400b6
ed3a201
b437996
e003bc9
98d195c
c6728dd
051f925
13b9b5b
1ae5965
67dd250
c73c36e
7d29fbc
7bb7a08
e6475a3
bc5c53b
e926871
6f9b5c0
f9580e6
ee941cf
5f6f16d
10b1443
0ad2051
9e1235d
b89df0b
3f637ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Improves performance on search screen by replacing flattenParents with directParentName in RoomSummary |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,9 +164,9 @@ data class RoomSummary( | |
| */ | ||
| val spaceChildren: List<SpaceChildInfo>? = null, | ||
| /** | ||
| * List of all the space parents. Will be empty by default, you have to explicitly request it. | ||
| * The name of the room's direct space parent if any | ||
| */ | ||
| val flattenParents: List<RoomSummary> = emptyList(), | ||
| val directParentName: String? = null, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ericdecanini this should be a list, you can have several direct parents. |
||
| /** | ||
| * List of all the space parent Ids. | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * 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.RoomSummaryEntityFields | ||
| import org.matrix.android.sdk.internal.util.database.RealmMigrator | ||
|
|
||
| internal class MigrateSessionTo030(realm: DynamicRealm) : RealmMigrator(realm, 30) { | ||
|
|
||
| override fun doMigrate(realm: DynamicRealm) { | ||
| realm.schema.get("RoomSummaryEntity") | ||
| ?.addField(RoomSummaryEntityFields.DIRECT_PARENT_NAME, String::class.java) | ||
| ?.transform { it.setString(RoomSummaryEntityFields.DIRECT_PARENT_NAME, "") } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we migrate it as empty here, it seems like it automatically syncs on launch and updates the value with the corresponding space parent of each room
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's updated after each sync. Is there a need to set a default value. |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be properly updated, if the parent name changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed this one, it properly updates