feat: retry message/reaction dialog#4195
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4195 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ View full report in Codecov by Sentry. |
|
Description pls. |
There was a problem hiding this comment.
Pull request overview
This pull request introduces a user-interactive retry mechanism for failed message and reaction sends in the Meshtastic Android application. Instead of automatically retrying failed sends, the system now prompts users with a dialog that displays a countdown timer and allows them to confirm, cancel, or wait for automatic retry. The maximum retry attempts have been reduced from 5 to 2.
Changes:
- Added
RetryEventsealed class and retry management infrastructure inServiceRepositorywith user response handling viaCompletableDeferredandConcurrentHashMap - Created new
RetryConfirmationDialogCompose component with countdown timer showing message preview and retry attempt information - Updated
MeshDataHandlerto emit retry events and wait for user confirmation before retrying messages/reactions - Integrated retry event observation and dialog display into
MessageScreen - Reduced
MAX_RETRY_ATTEMPTSconstant from 5 to 2 across the codebase - Added localized string resources for retry dialog UI elements
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| core/service/src/main/kotlin/org/meshtastic/core/service/ServiceRepository.kt | Adds RetryEvent sealed class and retry management methods (requestRetry, respondToRetry, cancelPendingRetries) using CompletableDeferred for user response coordination |
| app/src/main/java/com/geeksville/mesh/service/MeshDataHandler.kt | Modifies message/reaction retry logic to emit retry events and wait for user response before proceeding, removes automatic delay-based retry |
| feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/component/RetryConfirmationDialog.kt | New dialog component displaying retry confirmation with countdown timer, message/emoji preview, and action buttons |
| feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/Message.kt | Integrates retry event observation and dialog display in MessageScreen with handlers for user confirmation/cancellation |
| feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/MessageViewModel.kt | Exposes retryEvents flow and adds respondToRetry method to forward user responses to ServiceRepository |
| feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/MessageListPaged.kt | Updates maxRetries constant from 5 to 2 for message retry count display |
| feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/component/Reaction.kt | Updates maxRetries constant from 5 to 2 for reaction retry count display |
| core/strings/src/commonMain/composeResources/values/strings.xml | Adds 5 new string resources for retry dialog title, messages, and button labels |
|
@mdecourcy sounds like the robot has some issues with this, i kinda agree - we need to make sure this is done carefully. Tests would be good. |
This pull request introduces a user-interactive retry mechanism for failed message and reaction sends, replacing the previous automatic retry logic. Now, when a message or reaction fails to send, the user is prompted with a dialog to confirm or cancel the retry, with a countdown for automatic retry if no response is given. The maximum number of retry attempts has also been reduced from 5 to 2. The most important changes are as follows:
User-Interactive Retry Mechanism:
RetryEventsealed class and related logic inServiceRepositoryto emit retry events and handle user responses for message and reaction retries. The service now waits for user input (or times out) before retrying failed sends. [1] [2] [3] [4]MessageScreen), displaying a confirmation dialog with options to retry immediately, cancel, or wait for auto-retry. [1] [2] [3] [4] [5] [6]Configuration and Limits:
User Experience Enhancements:
General Maintenance:
These changes provide a more robust and user-friendly approach to handling message delivery failures, giving users more control over retry attempts.