From 3942e9bfa9c14bd50bfd5d271422358b5bd3af9d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 09:45:56 +0200 Subject: [PATCH 1/6] Add link to the Matrix room. --- docs/flipper.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/flipper.md b/docs/flipper.md index cc3b7eb5e0..495425ce5f 100644 --- a/docs/flipper.md +++ b/docs/flipper.md @@ -53,5 +53,6 @@ https://fbflipper.com/docs/getting-started/troubleshooting/android/ may help. ## Links -- https://fbflipper.com +- Official Flipper website: https://fbflipper.com - Realm Plugin for Flipper: https://github.com/kamgurgul/Flipper-Realm +- Dedicated Matrix room: https://matrix.to/#/#unifiedpush:matrix.org From ba8fcf9de3054a9b0612e07e8ae621d9d8b3736e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 12:17:09 +0200 Subject: [PATCH 2/6] Suppress issue on a tool. --- tools/dependencycheck/suppressions.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/dependencycheck/suppressions.xml b/tools/dependencycheck/suppressions.xml index 758b1a87f3..932bcdc08d 100644 --- a/tools/dependencycheck/suppressions.xml +++ b/tools/dependencycheck/suppressions.xml @@ -14,4 +14,11 @@ ^pkg:maven/com\.pinterest\.ktlint/ktlint\-reporter\-checkstyle@.*$ CVE-2019-9658 + + + ^pkg:maven/io\.github\.detekt\.sarif4k/sarif4k@.*$ + cpe:/a:detekt:detekt + From daa571957a447d7c1fda7f76165ba4768380d564 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 13:20:37 +0200 Subject: [PATCH 3/6] Replace task by much faster `dependencyCheckAnalyze` --- .github/workflows/quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 014139d0ba..d0797721e6 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -113,13 +113,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Dependency analysis - run: ./gradlew buildHealth $CI_GRADLE_ARG_PROPERTIES + run: ./gradlew dependencyCheckAnalyze $CI_GRADLE_ARG_PROPERTIES - name: Upload dependency analysis if: always() uses: actions/upload-artifact@v3 with: name: dependency-analysis - path: build/reports/dependency-analysis/build-health-report.txt + path: build/reports/dependency-check-report.html # Lint for main module android-lint: From 663812b90b1e4fd81f8ebfb9829847571c2fc257 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 14:36:07 +0200 Subject: [PATCH 4/6] Format file --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b767da14d7..f6a1906394 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Assemble GPlay unsigned apk - run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace + run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace - name: Upload Gplay unsigned APKs uses: actions/upload-artifact@v3 with: @@ -88,6 +88,6 @@ jobs: with: name: exodus.json path: | - exodus.json + exodus.json - name: Check for trackers run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }" From 705b55c57a09c3b643a72aa918d5f83b205bcf33 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 16:53:33 +0200 Subject: [PATCH 5/6] Use handy kotlin.time.Duration.Companion and remove default value. --- .../java/im/vector/app/core/utils/TemporaryStoreTest.kt | 3 ++- .../main/java/im/vector/app/core/utils/TemporaryStore.kt | 9 ++++----- .../home/room/detail/RoomDetailPendingActionStore.kt | 3 ++- .../java/im/vector/app/features/login/ReAuthHelper.kt | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt b/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt index 71a83f2e9b..303c1673dd 100644 --- a/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt +++ b/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt @@ -19,13 +19,14 @@ package im.vector.app.core.utils import org.amshove.kluent.shouldBe import org.junit.Test import java.lang.Thread.sleep +import kotlin.time.Duration.Companion.milliseconds class TemporaryStoreTest { @Test fun testTemporaryStore() { // Keep the data 300 millis - val store = TemporaryStore(300) + val store = TemporaryStore(300.milliseconds) store.data = "test" store.data shouldBe "test" diff --git a/vector/src/main/java/im/vector/app/core/utils/TemporaryStore.kt b/vector/src/main/java/im/vector/app/core/utils/TemporaryStore.kt index bd1e396126..809ba1173a 100644 --- a/vector/src/main/java/im/vector/app/core/utils/TemporaryStore.kt +++ b/vector/src/main/java/im/vector/app/core/utils/TemporaryStore.kt @@ -18,15 +18,14 @@ package im.vector.app.core.utils import java.util.Timer import java.util.TimerTask - -const val THREE_MINUTES = 3 * 60_000L +import kotlin.time.Duration /** * Store an object T for a specific period of time. * @param T type of the data to store - * @property delay delay to keep the data, in millis + * @property delay delay to keep the data */ -open class TemporaryStore(private val delay: Long = THREE_MINUTES) { +open class TemporaryStore(private val delay: Duration) { private var timer: Timer? = null @@ -40,7 +39,7 @@ open class TemporaryStore(private val delay: Long = THREE_MINUTES) { override fun run() { field = null } - }, delay) + }, delay.inWholeMilliseconds) } } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailPendingActionStore.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailPendingActionStore.kt index 9ffbb83a47..9dd6569cbd 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailPendingActionStore.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailPendingActionStore.kt @@ -19,7 +19,8 @@ package im.vector.app.features.home.room.detail import im.vector.app.core.utils.TemporaryStore import javax.inject.Inject import javax.inject.Singleton +import kotlin.time.Duration.Companion.seconds // Store to keep a pending action from sub screen of a room detail @Singleton -class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore(10_000) +class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore(10.seconds) diff --git a/vector/src/main/java/im/vector/app/features/login/ReAuthHelper.kt b/vector/src/main/java/im/vector/app/features/login/ReAuthHelper.kt index b29c930234..95cb4cc879 100644 --- a/vector/src/main/java/im/vector/app/features/login/ReAuthHelper.kt +++ b/vector/src/main/java/im/vector/app/features/login/ReAuthHelper.kt @@ -19,9 +19,10 @@ package im.vector.app.features.login import im.vector.app.core.utils.TemporaryStore import javax.inject.Inject import javax.inject.Singleton +import kotlin.time.Duration.Companion.minutes /** * Will store the account password for 3 minutes. */ @Singleton -class ReAuthHelper @Inject constructor() : TemporaryStore() +class ReAuthHelper @Inject constructor() : TemporaryStore(3.minutes) From 706e8e76277d5b94cc646ee1cbef8b4630eac889 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jun 2022 16:54:18 +0200 Subject: [PATCH 6/6] Ensure the test is less flaky... --- .../java/im/vector/app/core/utils/TemporaryStoreTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt b/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt index 303c1673dd..70af6e6419 100644 --- a/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt +++ b/vector/src/androidTest/java/im/vector/app/core/utils/TemporaryStoreTest.kt @@ -30,7 +30,7 @@ class TemporaryStoreTest { store.data = "test" store.data shouldBe "test" - sleep(10) + sleep(100) store.data shouldBe "test" sleep(300) store.data shouldBe null