feat: auto retry text message send on max retransmit (#4124)

This commit is contained in:
Mac DeCourcy 2026-01-03 04:21:43 -08:00 committed by GitHub
parent c9259c793f
commit 6bb40e4d20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 64 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.feature.messaging
import androidx.compose.foundation.layout.Column
@ -34,6 +33,7 @@ import org.jetbrains.compose.resources.pluralStringResource
import org.jetbrains.compose.resources.stringResource
import org.meshtastic.core.strings.Res
import org.meshtastic.core.strings.close
import org.meshtastic.core.strings.message_retry_count
import org.meshtastic.core.strings.relays
import org.meshtastic.core.strings.resend
@ -45,6 +45,8 @@ fun DeliveryInfo(
text: StringResource? = null,
relayNodeName: String? = null,
relays: Int = 0,
retryCount: Int = 0,
maxRetries: Int = 0,
onConfirm: (() -> Unit) = {},
onDismiss: () -> Unit = {},
) = AlertDialog(
@ -78,6 +80,14 @@ fun DeliveryInfo(
style = MaterialTheme.typography.bodyMedium,
)
}
if (maxRetries > 0) {
Text(
text = stringResource(Res.string.message_retry_count, retryCount, maxRetries),
modifier = Modifier.padding(top = 8.dp),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyMedium,
)
}
if (relays != 0) {
Text(
text = pluralStringResource(Res.plurals.relays, relays, relays),

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.feature.messaging
import androidx.compose.foundation.layout.Arrangement
@ -118,6 +117,8 @@ internal fun MessageListPaged(
nodes = state.nodes,
ourNode = state.ourNode,
resendOption = message.status?.equals(MessageStatus.ERROR) ?: false,
retryCount = message.retryCount,
maxRetries = 5,
onResend = {
handlers.onDeleteMessages(listOf(message.uuid))
handlers.onSendMessage(message.text, state.contactKey)
@ -436,6 +437,8 @@ internal fun MessageStatusDialog(
nodes: List<Node>,
ourNode: Node?,
resendOption: Boolean,
retryCount: Int,
maxRetries: Int,
onResend: () -> Unit,
onDismiss: () -> Unit,
) {
@ -454,6 +457,8 @@ internal fun MessageStatusDialog(
text = text,
relayNodeName = relayNodeName,
relays = message.relays,
retryCount = retryCount,
maxRetries = maxRetries,
onConfirm = onResend,
onDismiss = onDismiss,
)