Config update details and config syncing issue

This commit is contained in:
SessionHero01
2024-10-09 10:32:05 +11:00
parent db8784f0db
commit a8839af112
7 changed files with 200 additions and 139 deletions

View File

@@ -55,7 +55,7 @@ interface StorageProtocol {
fun setProfilePicture(recipient: Recipient, newProfilePicture: String?, newProfileKey: ByteArray?)
fun setBlocksCommunityMessageRequests(recipient: Recipient, blocksMessageRequests: Boolean)
fun setUserProfilePicture(newProfilePicture: String?, newProfileKey: ByteArray?)
fun clearUserPic()
fun clearUserPic(clearConfig: Boolean = true)
// Signal
fun getOrGenerateRegistrationID(): Int

View File

@@ -115,8 +115,8 @@ suspend fun ConfigFactoryProtocol.waitUntilUserConfigsPushed(timeoutMills: Long
return withTimeoutOrNull(timeoutMills){
configUpdateNotifications
.onStart { emit(ConfigUpdateNotification.UserConfigs) } // Trigger the filtering immediately
.filter { it == ConfigUpdateNotification.UserConfigs && !needsPush() }
.onStart { emit(ConfigUpdateNotification.UserConfigsModified) } // Trigger the filtering immediately
.filter { it == ConfigUpdateNotification.UserConfigsModified && !needsPush() }
.first()
} != null
}
@@ -190,8 +190,10 @@ interface MutableGroupConfigs : GroupConfigs {
fun rekey()
}
sealed interface ConfigUpdateNotification {
data object UserConfigs : ConfigUpdateNotification
data object UserConfigsModified : ConfigUpdateNotification
data class UserConfigsMerged(val timestamp: Long) : ConfigUpdateNotification
data class GroupConfigsUpdated(val groupId: AccountId) : ConfigUpdateNotification
data class GroupConfigsDeleted(val groupId: AccountId) : ConfigUpdateNotification
}