Skip to content

Commit

Permalink
Merge branch 'release/1.4.16' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed May 23, 2022
2 parents 1141905 + 4096695 commit 710c6f3
Show file tree
Hide file tree
Showing 579 changed files with 6,591 additions and 5,754 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ jobs:
uses: actions/checkout@v2

- name: Build docs
run: ./gradlew dokkaHtml
run: |
sed -i.bak "s/.*nightly documentation.*//" ./matrix-sdk-android/docs/modules.md
rm ./matrix-sdk-android/docs/modules.md.bak
./gradlew dokkaHtml
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
Expand Down
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
Please also refer to the Changelog of Element Android: https://github.com/vector-im/element-android/blob/main/CHANGES.md

Changes in Matrix-SDK 1.4.16 (2022-05-23)
===================================================

Imported from Element 1.4.16. (https://github.com/vector-im/element-android/releases/tag/v1.4.16)

SDK API changes ⚠️
------------------
- New API to enable/disable key forwarding CryptoService#enableKeyGossiping()
- New API to limit room key request only to own devices MXCryptoConfig#limitRoomKeyRequestsToMyDevices
- Event Trail API has changed, now using AuditTrail events
- New API to manually accept an incoming key request CryptoService#manuallyAcceptRoomKeyRequest() ([#5559](https://github.com/vector-im/element-android/issues/5559))
- Small change in the Matrix class: deprecated methods have been removed and the constructor is now public. Also the fun `workerFactory()` has been renamed to `getWorkerFactory()` ([#5887](https://github.com/vector-im/element-android/issues/5887))
- Including SSL/TLS error handing when doing WellKnown lookups without a custom HomeServerConnectionConfig ([#5965](https://github.com/vector-im/element-android/issues/5965))


Changes in Matrix-SDK 1.4.14 (2022-05-10)
===================================================

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
classpath libs.gradle.gradlePlugin
classpath libs.gradle.kotlinPlugin
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.20"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.21"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
30 changes: 15 additions & 15 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ ext.versions = [
'targetCompat' : JavaVersion.VERSION_11,
]

def gradle = "7.0.4"
def gradle = "7.2.0"
// Ref: https://kotlinlang.org/releases.html
def kotlin = "1.6.0"
def kotlinCoroutines = "1.6.0"
def dagger = "2.40.5"
def kotlin = "1.6.21"
def kotlinCoroutines = "1.6.1"
def dagger = "2.42"
def retrofit = "2.9.0"
def arrow = "0.8.2"
def markwon = "4.6.2"
def moshi = "1.13.0"
def lifecycle = "2.4.0"
def lifecycle = "2.4.1"
def flowBinding = "1.2.0"
def epoxy = "4.6.2"
def mavericks = "2.5.0"
def glide = "4.12.0"
def mavericks = "2.6.1"
def glide = "4.13.2"
def bigImageViewer = "1.8.1"
def jjwt = "0.11.2"
def vanniktechEmoji = "0.8.0"
def jjwt = "0.11.5"
def vanniktechEmoji = "0.9.0"

// Testing
def mockk = "1.12.1"
def mockk = "1.12.4"
def espresso = "3.4.0"
def androidxTest = "1.4.0"
def androidxOrchestrator = "1.4.1"
Expand All @@ -45,15 +45,15 @@ ext.libs = [
'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines"
],
androidx : [
'appCompat' : "androidx.appcompat:appcompat:1.4.0",
'appCompat' : "androidx.appcompat:appcompat:1.4.1",
'core' : "androidx.core:core-ktx:1.7.0",
'recyclerview' : "androidx.recyclerview:recyclerview:1.2.1",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.3",
'fragmentKtx' : "androidx.fragment:fragment-ktx:1.4.0",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.2",
'fragmentKtx' : "androidx.fragment:fragment-ktx:1.4.1",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.3",
'work' : "androidx.work:work-runtime-ktx:2.7.1",
'autoFill' : "androidx.autofill:autofill:1.1.0",
'preferenceKtx' : "androidx.preference:preference-ktx:1.1.1",
'preferenceKtx' : "androidx.preference:preference-ktx:1.2.0",
'junit' : "androidx.test.ext:junit:1.1.3",
'lifecycleCommon' : "androidx.lifecycle:lifecycle-common:$lifecycle",
'lifecycleLivedata' : "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle",
Expand All @@ -72,7 +72,7 @@ ext.libs = [
'espressoIntents' : "androidx.test.espresso:espresso-intents:$espresso"
],
google : [
'material' : "com.google.android.material:material:1.5.0"
'material' : "com.google.android.material:material:1.6.0"
],
dagger : [
'dagger' : "com.google.dagger:dagger:$dagger",
Expand Down
2 changes: 2 additions & 0 deletions dependencies_groups.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ ext.groups = [
'io.github.detekt.sarif4k',
'io.github.microutils',
'io.github.reactivecircus.flowbinding',
'io.gitlab.arturbosch.detekt',
'io.grpc',
'io.jsonwebtoken',
'io.kindedj',
Expand Down Expand Up @@ -195,6 +196,7 @@ ext.groups = [
'org.testng',
'org.threeten',
'org.webjars',
'org.yaml',
'ru.noties',
'xerces',
'xml-apis',
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ vector.httpLogLevel=NONE
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
GROUP=org.matrix.android
POM_ARTIFACT_ID=matrix-android-sdk2
VERSION_NAME=1.4.14
VERSION_NAME=1.4.16

POM_PACKAGING=aar

Expand Down
14 changes: 10 additions & 4 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ apply plugin: "com.vanniktech.maven.publish"

buildscript {
repositories {
mavenCentral()
// Do not use `mavenCentral()`, it prevents Dependabot from working properly
maven {
url 'https://repo1.maven.org/maven2'
}
}
dependencies {
classpath "io.realm:realm-gradle-plugin:10.9.0"
Expand All @@ -20,7 +23,7 @@ dokkaHtml {
dokkaSourceSets {
configureEach {
// Emit warnings about not documented members.
reportUndocumented.set(true)
// reportUndocumented.set(true)
// Suppress legacy Riot's packages.
perPackageOption {
matchingRegex.set("org.matrix.android.sdk.internal.legacy.riot")
Expand Down Expand Up @@ -101,6 +104,9 @@ android {
freeCompilerArgs += [
// Disabled for now, there are too many errors. Could be handled in another dedicated PR
// '-Xexplicit-api=strict', // or warning
"-opt-in=kotlin.RequiresOptIn",
// Opt in for kotlinx.coroutines.FlowPreview
"-opt-in=kotlinx.coroutines.FlowPreview",
]
}

Expand Down Expand Up @@ -178,7 +184,7 @@ dependencies {
implementation libs.arrow.instances

// olm lib is now hosted in MavenCentral
implementation 'org.matrix.android:olm-sdk:3.2.10'
implementation 'org.matrix.android:olm-sdk:3.2.11'

// DI
implementation libs.dagger.dagger
Expand All @@ -195,7 +201,7 @@ dependencies {
implementation libs.apache.commonsImaging

// Phone number https://github.com/google/libphonenumber
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.47'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.48'

testImplementation libs.tests.junit
testImplementation 'org.robolectric:robolectric:4.7.3'
Expand Down
15 changes: 9 additions & 6 deletions matrix-sdk-android/docs/modules.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Module matrix-sdk-android

<!-- Note: the line below will appear only when the documentation is generated from Element-Android project, and not when it's generated from the SDK project -->
**Note**: You are viewing the nightly documentation of the Android Matrix SDK library. The documentation of the released library can be found here: [https://matrix-org.github.io/matrix-android-sdk2/](https://matrix-org.github.io/matrix-android-sdk2/)

## Welcome to the matrix-sdk-android documentation!

This pages list the complete API that this SDK is exposing to a client application.
Expand All @@ -8,11 +11,11 @@ This pages list the complete API that this SDK is exposing to a client applicati

A few entry points:

- **Matrix**: The app will have to create and manage a Matrix object.
- From this **Matrix** object, you will be able to get various services, including the **AuthenticationService**.
- With this **AuthenticationService** you will be able to get an existing **Session**, or create one using a **LoginWizard** or a **RegistrationWizard**, which will finally give you a **Session**.
- From the **Session**, you will be able to retrieve many Services, including the **RoomService**.
- From the **RoomService**, you will be able to list the rooms, create a **Room**, and get a specific **Room**.
- And from a **Room**, you will be able to do many things, including get a **Timeline**, send messages, etc.
- **[Matrix](org.matrix.android.sdk.api.Matrix)**: The app will have to create and manage a **[Matrix](org.matrix.android.sdk.api.Matrix)** object.
- From this **[Matrix](org.matrix.android.sdk.api.Matrix)** object, you will be able to get various services, including the **[AuthenticationService](org.matrix.android.sdk.api.auth.AuthenticationService)**.
- With this **[AuthenticationService](org.matrix.android.sdk.api.auth.AuthenticationService)** you will be able to get an existing **[Session](org.matrix.android.sdk.api.session.Session)**, or create one using a **[LoginWizard](org.matrix.android.sdk.api.auth.login.LoginWizard)** or a **[RegistrationWizard](org.matrix.android.sdk.api.auth.registration.RegistrationWizard)**, which will finally give you a **[Session](org.matrix.android.sdk.api.session.Session)**.
- From the **[Session](org.matrix.android.sdk.api.session.Session)**, you will be able to retrieve many Services, including the **[RoomService](org.matrix.android.sdk.api.session.room.RoomService)**.
- From the **[RoomService](org.matrix.android.sdk.api.session.room.RoomService)**, you will be able to list the rooms, create a **[Room](org.matrix.android.sdk.api.session.room.Room)**, and get a specific **[Room](org.matrix.android.sdk.api.session.room.Room)**.
- And from a **[Room](org.matrix.android.sdk.api.session.room.Room)**, you will be able to do many things, including get a **[Timeline](org.matrix.android.sdk.api.session.room.timeline.Timeline)**, send messages, etc.

Please read the whole documentation to learn more!
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ class PermalinkParserTest {
Assert.assertTrue("Should be parsed as email invite but was ${parsedLink::class.java}", parsedLink is PermalinkData.RoomEmailInviteLink)
parsedLink as PermalinkData.RoomEmailInviteLink
Assert.assertEquals("!MRBNLPtFnMAazZVPMO:matrix.org", parsedLink.roomId)
Assert.assertEquals("XmOwRZnSFabCRhTywFbJWKXWVNPysOpXIbroMGaUymqkJSvHeVKRsjHajwjCYdBsvGSvHauxbKfJmOxtXldtyLnyBMLKpBQCMzyYggrdapbVIceWZBtmslOQrXLABRoe", parsedLink.token)
Assert.assertEquals(
"XmOwRZnSFabCRhTywFbJWKXWVNPysOpXIbroMGaUymqkJSvHeVKRsjHajwjCYdBsvGSvHauxbKfJmOxtXldtyLnyBMLKpBQCMzyYggrdapbVIceWZBtmslOQrXLABRoe",
parsedLink.token
)
Assert.assertEquals("vector.im", parsedLink.identityServer)
Assert.assertEquals("Team2", parsedLink.roomName)
Assert.assertEquals("hiphop5", parsedLink.inviterName)
}

@Test
fun testParseLinkWIthEvent() {
val rawInvite = "https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org/\$xuvJUVDJnwEeVjPx029rAOZ50difpmU_5gZk_T0jGfc?via=matrix.org&via=libera.chat&via=matrix.example.io"
val rawInvite =
"https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org/\$xuvJUVDJnwEeVjPx029rAOZ50difpmU_5gZk_T0jGfc?via=matrix.org&via=libera.chat&via=matrix.example.io"

val parsedLink = PermalinkParser.parse(rawInvite)
Assert.assertTrue("Should be parsed as room link", parsedLink is PermalinkData.RoomLink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ import kotlinx.coroutines.asCoroutineDispatcher
import org.matrix.android.sdk.api.MatrixCoroutineDispatchers
import java.util.concurrent.Executors

internal val testCoroutineDispatchers = MatrixCoroutineDispatchers(Main, Main, Main, Main,
Executors.newSingleThreadExecutor().asCoroutineDispatcher())
internal val testCoroutineDispatchers = MatrixCoroutineDispatchers(
Main, Main, Main, Main,
Executors.newSingleThreadExecutor().asCoroutineDispatcher()
)
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ class DeactivateAccountTest : InstrumentedTest {
val throwable = commonTestHelper.logAccountWithError(session.myUserId, TestConstants.PASSWORD)

// Test the error
assertTrue(throwable is Failure.ServerError &&
throwable.error.code == MatrixError.M_USER_DEACTIVATED &&
throwable.error.message == "This account has been deactivated")
assertTrue(
throwable is Failure.ServerError &&
throwable.error.code == MatrixError.M_USER_DEACTIVATED &&
throwable.error.message == "This account has been deactivated"
)

// Try to create an account with the deactivate account user id, it will fail (M_USER_IN_USE)
val hs = commonTestHelper.createHomeServerConfig()
Expand All @@ -95,8 +97,10 @@ class DeactivateAccountTest : InstrumentedTest {

// Test the error
accountCreationError.let {
assertTrue(it is Failure.ServerError &&
it.error.code == MatrixError.M_USER_IN_USE)
assertTrue(
it is Failure.ServerError &&
it.error.code == MatrixError.M_USER_IN_USE
)
}

// No need to close the session, it has been deactivated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ class CommonTestHelper(context: Context) {
fun getTestInterceptor(session: Session): MockOkHttpInterceptor? = TestModule.interceptorForSession(session.sessionId) as? MockOkHttpInterceptor

init {
var _matrix: TestMatrix? = null
UiThreadStatement.runOnUiThread {
TestMatrix.initialize(
_matrix = TestMatrix(
context,
MatrixConfiguration(
applicationFlavor = "TestFlavor",
roomDisplayNameFallbackProvider = TestRoomDisplayNameFallbackProvider()
)
)
}
matrix = TestMatrix.getInstance()
matrix = _matrix!!
}

fun createAccount(userNamePrefix: String, testParams: SessionTestParams): Session {
Expand Down
Loading

0 comments on commit 710c6f3

Please sign in to comment.