Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4313.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix unread marker not showing
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ class RoomDetailViewModel @AssistedInject constructor(
val isAllowed = action.userJustAccepted || if (widget.type == WidgetType.Jitsi) {
widget.senderInfo?.userId == session.myUserId ||
session.integrationManagerService().isNativeWidgetDomainAllowed(
action.widget.type.preferred,
domain
)
action.widget.type.preferred,
domain
)
} else false

if (isAllowed) {
Expand Down Expand Up @@ -1092,8 +1092,10 @@ class RoomDetailViewModel @AssistedInject constructor(
}

override fun onTimelineUpdated(snapshot: List<TimelineEvent>) {
timelineEvents.tryEmit(snapshot)

viewModelScope.launch {
// tryEmit doesn't work with SharedFlow without cache

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the fix. How can we avoid such error to come back in the future?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the DataSource abstraction we have? (not yet migrated to Flow)

timelineEvents.emit(snapshot)
}
// PreviewUrl
if (vectorPreferences.showUrlPreviews()) {
withState { state ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.sample
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
Expand Down Expand Up @@ -110,7 +111,7 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
if (
crossSigningInfo.getOrNull() == null ||
(crossSigningInfo.getOrNull()?.isTrusted() == true &&
pInfo.getOrNull()?.allKnown().orFalse())
pInfo.getOrNull()?.allKnown().orFalse())
) {
// So 4S is not setup and we have local secrets,
return@combine BannerState.Setup(numberOfKeys = getNumberOfKeysToBackup())
Expand All @@ -125,7 +126,9 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
)
}

keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
viewModelScope.launch {
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
}
}

/**
Expand Down Expand Up @@ -155,7 +158,9 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
}

override fun onStateChange(newState: KeysBackupState) {
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
viewModelScope.launch {
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
}
keysBackupState.value = newState
}

Expand Down