mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Merge branch 'hotfix/1.5.14' into main
This commit is contained in:
commit
4a46289fda
8 changed files with 27 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Changes in Element v1.5.14 (2022-12-20)
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
Bugfixes 🐛
|
||||||
|
----------
|
||||||
|
- ActiveSessionHolder is not supposed to start syncing. Instead, the MainActivity does it, if necessary. Fixes a race condition when clearing cache.
|
||||||
|
|
||||||
|
|
||||||
Changes in Element v1.5.13 (2022-12-19)
|
Changes in Element v1.5.13 (2022-12-19)
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
|
|
2
fastlane/metadata/android/en-US/changelogs/40105140.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/40105140.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Main changes in this version: Thread are now enabled by default.
|
||||||
|
Full changelog: https://github.com/vector-im/element-android/releases
|
|
@ -62,7 +62,7 @@ android {
|
||||||
// that the app's state is completely cleared between tests.
|
// that the app's state is completely cleared between tests.
|
||||||
testInstrumentationRunnerArguments clearPackageData: 'true'
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
||||||
|
|
||||||
buildConfigField "String", "SDK_VERSION", "\"1.5.13\""
|
buildConfigField "String", "SDK_VERSION", "\"1.5.14\""
|
||||||
|
|
||||||
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
|
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
|
||||||
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""
|
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""
|
||||||
|
|
|
@ -37,7 +37,7 @@ ext.versionMinor = 5
|
||||||
// Note: even values are reserved for regular release, odd values for hotfix release.
|
// Note: even values are reserved for regular release, odd values for hotfix release.
|
||||||
// When creating a hotfix, you should decrease the value, since the current value
|
// When creating a hotfix, you should decrease the value, since the current value
|
||||||
// is the value for the next regular release.
|
// is the value for the next regular release.
|
||||||
ext.versionPatch = 13
|
ext.versionPatch = 14
|
||||||
|
|
||||||
static def getGitTimestamp() {
|
static def getGitTimestamp() {
|
||||||
def cmd = 'git show -s --format=%ct'
|
def cmd = 'git show -s --format=%ct'
|
||||||
|
|
|
@ -18,7 +18,6 @@ package im.vector.app.core.di
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import im.vector.app.ActiveSessionDataSource
|
import im.vector.app.ActiveSessionDataSource
|
||||||
import im.vector.app.core.extensions.startSyncing
|
|
||||||
import im.vector.app.core.pushers.UnregisterUnifiedPushUseCase
|
import im.vector.app.core.pushers.UnregisterUnifiedPushUseCase
|
||||||
import im.vector.app.core.services.GuardServiceStarter
|
import im.vector.app.core.services.GuardServiceStarter
|
||||||
import im.vector.app.core.session.ConfigureAndStartSessionUseCase
|
import im.vector.app.core.session.ConfigureAndStartSessionUseCase
|
||||||
|
@ -72,7 +71,7 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
|
|
||||||
suspend fun clearActiveSession() {
|
suspend fun clearActiveSession() {
|
||||||
// Do some cleanup first
|
// Do some cleanup first
|
||||||
getSafeActiveSession(startSync = false)?.let {
|
getSafeActiveSession()?.let {
|
||||||
Timber.w("clearActiveSession of ${it.myUserId}")
|
Timber.w("clearActiveSession of ${it.myUserId}")
|
||||||
it.callSignalingService().removeCallListener(callManager)
|
it.callSignalingService().removeCallListener(callManager)
|
||||||
it.removeListener(sessionListener)
|
it.removeListener(sessionListener)
|
||||||
|
@ -93,8 +92,8 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
return activeSessionReference.get() != null || authenticationService.hasAuthenticatedSessions()
|
return activeSessionReference.get() != null || authenticationService.hasAuthenticatedSessions()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSafeActiveSession(startSync: Boolean = true): Session? {
|
fun getSafeActiveSession(): Session? {
|
||||||
return runBlocking { getOrInitializeSession(startSync = startSync) }
|
return runBlocking { getOrInitializeSession() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getActiveSession(): Session {
|
fun getActiveSession(): Session {
|
||||||
|
@ -102,16 +101,11 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
?: throw IllegalStateException("You should authenticate before using this")
|
?: throw IllegalStateException("You should authenticate before using this")
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getOrInitializeSession(startSync: Boolean): Session? {
|
suspend fun getOrInitializeSession(): Session? {
|
||||||
return activeSessionReference.get()
|
return activeSessionReference.get()
|
||||||
?.also {
|
|
||||||
if (startSync && !it.syncService().isSyncThreadAlive()) {
|
|
||||||
it.startSyncing(applicationContext)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?: sessionInitializer.tryInitialize(readCurrentSession = { activeSessionReference.get() }) { session ->
|
?: sessionInitializer.tryInitialize(readCurrentSession = { activeSessionReference.get() }) { session ->
|
||||||
setActiveSession(session)
|
setActiveSession(session)
|
||||||
configureAndStartSessionUseCase.execute(session, startSyncing = startSync)
|
configureAndStartSessionUseCase.execute(session, startSyncing = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ class VectorPushHandler @Inject constructor(
|
||||||
Timber.tag(loggerTag.value).d("## handleInternal()")
|
Timber.tag(loggerTag.value).d("## handleInternal()")
|
||||||
}
|
}
|
||||||
|
|
||||||
val session = activeSessionHolder.getOrInitializeSession(startSync = false)
|
val session = activeSessionHolder.getOrInitializeSession()
|
||||||
|
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
Timber.tag(loggerTag.value).w("## Can't sync from push, no current session")
|
Timber.tag(loggerTag.value).w("## Can't sync from push, no current session")
|
||||||
|
|
|
@ -174,12 +174,15 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
|
||||||
private fun handleAppStarted() {
|
private fun handleAppStarted() {
|
||||||
if (intent.hasExtra(EXTRA_NEXT_INTENT)) {
|
if (intent.hasExtra(EXTRA_NEXT_INTENT)) {
|
||||||
// Start the next Activity
|
// Start the next Activity
|
||||||
|
startSyncing()
|
||||||
val nextIntent = intent.getParcelableExtraCompat<Intent>(EXTRA_NEXT_INTENT)
|
val nextIntent = intent.getParcelableExtraCompat<Intent>(EXTRA_NEXT_INTENT)
|
||||||
startIntentAndFinish(nextIntent)
|
startIntentAndFinish(nextIntent)
|
||||||
} else if (intent.hasExtra(EXTRA_INIT_SESSION)) {
|
} else if (intent.hasExtra(EXTRA_INIT_SESSION)) {
|
||||||
|
startSyncing()
|
||||||
setResult(RESULT_OK)
|
setResult(RESULT_OK)
|
||||||
finish()
|
finish()
|
||||||
} else if (intent.action == ACTION_ROOM_DETAILS_FROM_SHORTCUT) {
|
} else if (intent.action == ACTION_ROOM_DETAILS_FROM_SHORTCUT) {
|
||||||
|
startSyncing()
|
||||||
val roomId = intent.getStringExtra(EXTRA_ROOM_ID)
|
val roomId = intent.getStringExtra(EXTRA_ROOM_ID)
|
||||||
if (roomId?.isNotEmpty() == true) {
|
if (roomId?.isNotEmpty() == true) {
|
||||||
navigator.openRoom(this, roomId, trigger = ViewRoom.Trigger.Shortcut)
|
navigator.openRoom(this, roomId, trigger = ViewRoom.Trigger.Shortcut)
|
||||||
|
@ -194,11 +197,16 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
|
||||||
if (args.clearCache || args.clearCredentials) {
|
if (args.clearCache || args.clearCredentials) {
|
||||||
doCleanUp()
|
doCleanUp()
|
||||||
} else {
|
} else {
|
||||||
|
startSyncing()
|
||||||
startNextActivityAndFinish()
|
startNextActivityAndFinish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun startSyncing() {
|
||||||
|
activeSessionHolder.getSafeActiveSession()?.startSyncing(this)
|
||||||
|
}
|
||||||
|
|
||||||
private fun clearNotifications() {
|
private fun clearNotifications() {
|
||||||
// Dismiss all notifications
|
// Dismiss all notifications
|
||||||
notificationDrawerManager.clearAllEvents()
|
notificationDrawerManager.clearAllEvents()
|
||||||
|
|
|
@ -63,7 +63,7 @@ class StartAppViewModel @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun eagerlyInitializeSession() {
|
private suspend fun eagerlyInitializeSession() {
|
||||||
sessionHolder.getOrInitializeSession(startSync = true)
|
sessionHolder.getOrInitializeSession()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleLongProcessing() {
|
private fun handleLongProcessing() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue