Repository navigation
Keep Offline Mode pings when a radio drop ends the drive - #40
Merged
Merged
Conversation
The cleanup after an abandoned reconnect stored the Session History entry but never wrote the offline pings, so a drive could sit in History with no offline file. It now saves them the way Disconnect does, using the remembered radio config and device name since the connection is already gone. A save also stopped the 60 s auto-save, and only toggling Offline Mode restarted it, so every later connect or mode start in the same Offline Mode stint ran without one. The auto-save now runs until Offline Mode is turned off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two gaps let an Offline Mode drive appear in Session History with no offline file to upload. They came up while looking into MeshMapper/MeshMapper_Project#605 ("Data not uploading": a drive in History, nothing on the map, nothing in offline records).
These may not be what hit that reporter. The app also saves an offline snapshot whenever it is backgrounded or the screen locks, so both gaps only lose pings if the app dies (a crash, for example) before that snapshot runs. We still need the reporter's History card (date, time, mode name) to say which way their drive went.
What changed
_fullDisconnectCleanupImplstored the Session History entry and cleared the queue but never called_saveOfflineSession(). The pings stayed only in memory, which every app launch clears._lastRadioConfig) and device name (_displayDeviceName). Without that, the file would lack the device and radio details its upload uses._saveOfflineSession()used to stop it, and only toggling Offline Mode restarted it. After the first stop, disconnect or failed switch to online, every later connect or mode start ran without an auto-save.DEVELOPMENT.md, Offline Mode: a note on when pings are written to the file.Testing
flutter analyze: no issues.flutter test: all passed (2536, 1 skipped).AppStateProvideris never constructed in tests, and the change lives in its teardown wiring.[APP] Saved offline session with N pingsstraight after the cleanup, and the drive should already be in Settings > Data without leaving the app. Leaving the app first would hide the bug, because the background snapshot saves the pings anyway.[OFFLINE] Updated sessionlines during the second run.