Use QNetworkInformation to queue QFieldCloud pushes offline and resume when back online
This change makes projectPush() network aware. When the device is offline, pushes are queued instead of expiring/timing out, and are automatically retried once the network becomes active again
Details
- Use QNetworkInformation::Reachability (when available) to decide if the network looks active enough for a cloud push.
- If the network is not active:
- Store the requested push in a small in-memory queue keyed by projectId (merging shouldDownloadUpdates if multiple requests arrive for the same project).
- Emit a warning() message: “Network is not currently active. We will push the changes automatically once you are back online.”
- When reachability changes back to an active state, the queued pushes are flushed by recalling projectPush() for each queued project.
- If QNetworkInformation or Reachability is not supported, behaviour stays unchanged (we dont block any pushes)
Behaviour notes
- We still respect the existing ProjectStatus::Idle check before pushing
- No changes to the QML API surface, the existing warning signal is used to show the message to the user
https://github.com/user-attachments/assets/c1545f8c-22ab-4187-92be-9be88d2a7746
🎉 Ta-daaa, freshly created APKs are available for 53d278a2819a4168da0e554bebb63be49852589e: arm64-android
🍎 MacOS DMG universal builds
Download a MacOS DMG universal build of this PR for testing. (Built from commit 53d278a2819a4168da0e554bebb63be49852589e)
🐧 Linux AppImage builds
Download a Linux AppImage build of this PR for testing. (Built from commit 53d278a2819a4168da0e554bebb63be49852589e)
🪟 Windows builds
Download a Windows build of this PR for testing. (Built from commit 53d278a2819a4168da0e554bebb63be49852589e)