Merge branch 'develop' into fix/crash-on-nightly-incorrect-di-cast

This commit is contained in:
Jorge Martin Espinosa 2025-12-22 16:04:25 +01:00 committed by GitHub
commit 55185b540d
11 changed files with 119 additions and 107 deletions

View file

@ -28,7 +28,7 @@ class DiffCacheUpdater<ListItem, CachedItem>(
private val cacheInvalidator: DiffCacheInvalidator<CachedItem> = DefaultDiffCacheInvalidator(),
private val areItemsTheSame: (oldItem: ListItem?, newItem: ListItem?) -> Boolean,
) {
private val lock = Object()
private val lock = Any()
private var prevOriginalList: List<ListItem> = emptyList()
private val listUpdateCallback = object : ListUpdateCallback {

View file

@ -30,6 +30,7 @@ object LinkifyHelper {
@LinkifyCompat.LinkifyMask linkifyMask: Int = Linkify.WEB_URLS or Linkify.PHONE_NUMBERS or Linkify.EMAIL_ADDRESSES,
): CharSequence {
// Convert the text to a Spannable to be able to add URL spans, return the original text if it's not possible (in tests, i.e.)
@Suppress("USELESS_ELVIS")
val spannable = text.toSpannable() ?: return text
// Get all URL spans, as they will be removed by LinkifyCompat.addLinks

View file

@ -158,7 +158,7 @@ class FakeTimeline(
imageInfo: ImageInfo,
body: String?,
formattedBody: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -169,7 +169,7 @@ class FakeTimeline(
imageInfo: ImageInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<MediaUploadHandler> = simulateLongTask {
sendImageLambda(
file,
@ -187,7 +187,7 @@ class FakeTimeline(
videoInfo: VideoInfo,
body: String?,
formattedBody: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<MediaUploadHandler> = { _, _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -198,7 +198,7 @@ class FakeTimeline(
videoInfo: VideoInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<MediaUploadHandler> = simulateLongTask {
sendVideoLambda(
file,
@ -215,7 +215,7 @@ class FakeTimeline(
audioInfo: AudioInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<MediaUploadHandler> = { _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -225,7 +225,7 @@ class FakeTimeline(
audioInfo: AudioInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<MediaUploadHandler> = simulateLongTask {
sendAudioLambda(
file,
@ -241,7 +241,7 @@ class FakeTimeline(
fileInfo: FileInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<MediaUploadHandler> = { _, _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -251,7 +251,7 @@ class FakeTimeline(
fileInfo: FileInfo,
caption: String?,
formattedCaption: String?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<MediaUploadHandler> = simulateLongTask {
sendFileLambda(
file,
@ -266,7 +266,7 @@ class FakeTimeline(
file: File,
audioInfo: AudioInfo,
waveform: List<Float>,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<MediaUploadHandler> = { _, _, _, _ ->
Result.success(FakeMediaUploadHandler())
}
@ -275,7 +275,7 @@ class FakeTimeline(
file: File,
audioInfo: AudioInfo,
waveform: List<Float>,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<MediaUploadHandler> = simulateLongTask {
sendVoiceMessageLambda(
file,
@ -291,7 +291,7 @@ class FakeTimeline(
description: String?,
zoomLevel: Int?,
assetType: AssetType?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
) -> Result<Unit> = { _, _, _, _, _, _ ->
lambdaError()
}
@ -302,7 +302,7 @@ class FakeTimeline(
description: String?,
zoomLevel: Int?,
assetType: AssetType?,
inReplyToEventId: EventId??,
inReplyToEventId: EventId?,
): Result<Unit> = simulateLongTask {
sendLocationLambda(
body,