Merge pull request #6340 from vector-im/feature/bma/test_flipper

Add link to the Matrix room.
This commit is contained in:
Benoit Marty 2022-06-17 18:02:19 +02:00 committed by GitHub
commit 3dcec85dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 14 deletions

View File

@ -60,7 +60,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Assemble GPlay unsigned apk - 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 - name: Upload Gplay unsigned APKs
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -88,6 +88,6 @@ jobs:
with: with:
name: exodus.json name: exodus.json
path: | path: |
exodus.json exodus.json
- name: Check for trackers - name: Check for trackers
run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }" run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }"

View File

@ -113,13 +113,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Dependency analysis - name: Dependency analysis
run: ./gradlew buildHealth $CI_GRADLE_ARG_PROPERTIES run: ./gradlew dependencyCheckAnalyze $CI_GRADLE_ARG_PROPERTIES
- name: Upload dependency analysis - name: Upload dependency analysis
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: dependency-analysis name: dependency-analysis
path: build/reports/dependency-analysis/build-health-report.txt path: build/reports/dependency-check-report.html
# Lint for main module # Lint for main module
android-lint: android-lint:

View File

@ -53,5 +53,6 @@ https://fbflipper.com/docs/getting-started/troubleshooting/android/ may help.
## Links ## Links
- https://fbflipper.com - Official Flipper website: https://fbflipper.com
- Realm Plugin for Flipper: https://github.com/kamgurgul/Flipper-Realm - Realm Plugin for Flipper: https://github.com/kamgurgul/Flipper-Realm
- Dedicated Matrix room: https://matrix.to/#/#unifiedpush:matrix.org

View File

@ -14,4 +14,11 @@
<packageUrl regex="true">^pkg:maven/com\.pinterest\.ktlint/ktlint\-reporter\-checkstyle@.*$</packageUrl> <packageUrl regex="true">^pkg:maven/com\.pinterest\.ktlint/ktlint\-reporter\-checkstyle@.*$</packageUrl>
<cve>CVE-2019-9658</cve> <cve>CVE-2019-9658</cve>
</suppress> </suppress>
<suppress until="2023-01-01Z">
<notes><![CDATA[
file name: sarif4k-0.0.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/io\.github\.detekt\.sarif4k/sarif4k@.*$</packageUrl>
<cpe>cpe:/a:detekt:detekt</cpe>
</suppress>
</suppressions> </suppressions>

View File

@ -19,17 +19,18 @@ package im.vector.app.core.utils
import org.amshove.kluent.shouldBe import org.amshove.kluent.shouldBe
import org.junit.Test import org.junit.Test
import java.lang.Thread.sleep import java.lang.Thread.sleep
import kotlin.time.Duration.Companion.milliseconds
class TemporaryStoreTest { class TemporaryStoreTest {
@Test @Test
fun testTemporaryStore() { fun testTemporaryStore() {
// Keep the data 300 millis // Keep the data 300 millis
val store = TemporaryStore<String>(300) val store = TemporaryStore<String>(300.milliseconds)
store.data = "test" store.data = "test"
store.data shouldBe "test" store.data shouldBe "test"
sleep(10) sleep(100)
store.data shouldBe "test" store.data shouldBe "test"
sleep(300) sleep(300)
store.data shouldBe null store.data shouldBe null

View File

@ -18,15 +18,14 @@ package im.vector.app.core.utils
import java.util.Timer import java.util.Timer
import java.util.TimerTask import java.util.TimerTask
import kotlin.time.Duration
const val THREE_MINUTES = 3 * 60_000L
/** /**
* Store an object T for a specific period of time. * Store an object T for a specific period of time.
* @param T type of the data to store * @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<T>(private val delay: Long = THREE_MINUTES) { open class TemporaryStore<T>(private val delay: Duration) {
private var timer: Timer? = null private var timer: Timer? = null
@ -40,7 +39,7 @@ open class TemporaryStore<T>(private val delay: Long = THREE_MINUTES) {
override fun run() { override fun run() {
field = null field = null
} }
}, delay) }, delay.inWholeMilliseconds)
} }
} }
} }

View File

@ -19,7 +19,8 @@ package im.vector.app.features.home.room.detail
import im.vector.app.core.utils.TemporaryStore import im.vector.app.core.utils.TemporaryStore
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
import kotlin.time.Duration.Companion.seconds
// Store to keep a pending action from sub screen of a room detail // Store to keep a pending action from sub screen of a room detail
@Singleton @Singleton
class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore<RoomDetailPendingAction>(10_000) class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore<RoomDetailPendingAction>(10.seconds)

View File

@ -19,9 +19,10 @@ package im.vector.app.features.login
import im.vector.app.core.utils.TemporaryStore import im.vector.app.core.utils.TemporaryStore
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
import kotlin.time.Duration.Companion.minutes
/** /**
* Will store the account password for 3 minutes. * Will store the account password for 3 minutes.
*/ */
@Singleton @Singleton
class ReAuthHelper @Inject constructor() : TemporaryStore<String>() class ReAuthHelper @Inject constructor() : TemporaryStore<String>(3.minutes)