Add room sync controls with polished room server status UI#172
Add room sync controls with polished room server status UI#172Specter242 wants to merge 9 commits intozjs81:mainfrom
Conversation
Introduce app-side room auto-sync orchestration with per-room enablement, sync status indicators, and configurable timing controls so users can keep only selected room servers up to date. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Quick validation checklist for reviewers:
If helpful, I can also attach short screen recordings for the settings flow and per-room toggle behavior. |
|
Test coverage note: this change set was validated on Android hardware. I was not able to run iOS validation in this environment. |
This replaces fragile string-based room sync status coloring with explicit status kinds and removes the redundant contacts legend so room status text remains clear and consistent. Co-authored-by: Cursor <cursoragent@cursor.com>
|
I will test this out today and review, then move to #173 |
|
Pushed an update to :\n\n- Register manual room login in so successful manual room logins mark the room session active and persist login success.\n- Call that registration from immediately after successful login.\n\nThis fixes the status mismatch where a connected/logged-in room could still show as not synced/not logged in until auto-login kicked in. |
|
Pushed an update to feature/room-sync-controls. Changes:
Result:
|
|
Pushed an update to the PR branch () in commit . Change included:
This fixes stale status when the device has been out of range and reconnection is still in progress. |
|
Update pushed to PR branch feature/room-sync-controls in commit 151fbb3. Included fix:
This addresses stale Connected, synced status after long out-of-range periods while reconnecting. |
|
Quick update on room-server sync behavior (focused on low traffic + better state visibility):
|
(cherry picked from commit 9a5d189)
…trols # Conflicts: # lib/models/app_settings.dart # lib/screens/app_settings_screen.dart # lib/screens/chat_screen.dart # lib/screens/contacts_screen.dart # lib/services/app_settings_service.dart
|
Sorry was meant to be for #173. Please ignore mention for this PR. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab76c3e261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lib/services/room_sync_service.dart
Outdated
| code == respCodeNoMoreMessages || | ||
| code == respCodeContactMsgRecv || | ||
| code == respCodeContactMsgRecvV3 || | ||
| code == respCodeChannelMsgRecv || | ||
| code == respCodeChannelMsgRecvV3; |
There was a problem hiding this comment.
Mark sync complete only after end-of-queue response
This treats any incoming message frame as a successful sync cycle, but MeshCoreConnector.syncQueuedMessages() continues fetching until respCodeNoMoreMessages. If a room has multiple queued messages and the transport stalls after the first one, _markSyncSuccess() runs early, cancels the timeout, resets backoff, and updates lastSuccessfulSyncAtMs even though catch-up did not finish, which can incorrectly report rooms as healthy while backlog remains.
Useful? React with 👍 / 👎.
| void _onConnected() { | ||
| if (!_roomSyncEnabled) return; | ||
| _currentInterval = _defaultSyncInterval; | ||
| _scheduleNextSync(_defaultSyncInterval); | ||
| unawaited(_autoLoginSavedRooms()); |
There was a problem hiding this comment.
Start room sync when setting is enabled mid-connection
Periodic sync and auto-login are only kicked off from _onConnected(), but this service never subscribes to AppSettingsService changes. In a common flow where a user connects first and then enables "Enable room auto-sync" in settings, no timer or auto-login pass is started until a reconnect/manual trigger occurs, so the new toggle does not take effect during the current session.
Useful? React with 👍 / 👎.
Address two Codex review items and two UX gaps: P1 (Codex): _markSyncSuccess() now only fires on respCodeNoMoreMessages. Intermediate message receipt codes (respCodeContactMsgRecv*, respCodeChannelMsgRecv*) extend the sync timeout instead, so a large backlog draining does not cause a premature success or a false timeout failure. P2 (Codex): RoomSyncService now subscribes to AppSettingsService changes via _handleSettingsChange(). Enabling room auto-sync while already connected starts the periodic timer and auto-login immediately; disabling it cancels both timers. The _lastRoomSyncEnabled flag tracks the transition so the handler is a no-op when the value has not changed. Unread badge clearing: markContactRead() for room contacts is now called at tile-tap time (matching regular contact behaviour) rather than inside the onLogin callback, so the badge clears consistently even if the user later cancels the login dialog. Login dialog bypass: _showRoomLogin() skips the login dialog for the chat destination when the room already has an active session (isRoomSessionActive()). The login dialog continues to appear when there is no active session or when opening Room Management (which needs the password for admin commands). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolved additive conflicts in 5 files: - lib/main.dart: keep ChatTextScaleService (main) + RoomSyncService (PR) - lib/models/app_settings.dart: keep mutedChannels (main) + room sync fields (PR) - lib/services/app_settings_service.dart: keep setBatteryChemistryForRepeater (main) + room sync setters (PR) - lib/screens/chat_screen.dart: keep chat_zoom_wrapper import (main) + room_sync_service import (PR) - lib/screens/contacts_screen.dart: keep isFavorite (main) + roomSyncService/isRoomSessionActive (PR) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Changes in this updateBug fixes (addressing Codex review)P1 — P2 — UX improvementsUnread badge clear timing ( Skip login dialog when already authenticated ( MergeRebased/merged with |
Summary
UI/UX polish included
synced,syncing,stale/waiting,disabled/not logged in).Test plan
dart formaton changed filesflutter analyzeflutter build apk --debug+adb install -r)