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

Remove spec v1.3 check for threads #5997

Merged
merged 3 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5997.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update check for server-side threads support to match spec.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ internal fun Versions.isLoginAndRegistrationSupportedBySdk(): Boolean {
* Indicate if the homeserver support MSC3440 for threads
*/
internal fun Versions.doesServerSupportThreads(): Boolean {
return getMaxVersion() >= HomeServerVersion.v1_3_0 ||
unstableFeatures?.get(FEATURE_THREADS_MSC3440_STABLE) ?: false
// TODO: Check for v1.3 or whichever spec version formally specifies MSC3440.
Copy link
Member

Choose a reason for hiding this comment

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

Does this TODO means that it has to be done before merging this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is a future note so we can find the code site.

return unstableFeatures?.get(FEATURE_THREADS_MSC3440_STABLE) ?: false
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class VersionsKtTest {
Versions(supportedVersions = listOf("r0.6.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("r0.9.1")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.2.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.3.0")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.5.1")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.3.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.5.1")).doesServerSupportThreads() shouldBe false
turt2live marked this conversation as resolved.
Show resolved Hide resolved
Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.2.1"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.4.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.4.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe false
}
}