-
-
Notifications
You must be signed in to change notification settings - Fork 285
Use QNetworkInformation to queue QFieldCloud pushes offline and resume when back online #6879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Use QNetworkInformation to queue QFieldCloud pushes offline and resume when back online #6879
Conversation
…push the changes as soon as the network is available
|
🎉 Ta-daaa, freshly created APKs are available for 53d278a: arm64-android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
|
||
| const int mProjectsPerFetch = 250; | ||
|
|
||
| bool networkLooksActive() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one minor naming suggestion regarding the networkLooksActive() method.
Since the method is actually checking QNetworkInformation::reachability(), a name that reflects the reachability aspect might make the intent clearer to future readers.
Something like isReachableToCloud()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely, thankyou for the input @mohsenD98 😄
🍎 MacOS DMG universal buildsDownload a MacOS DMG universal build of this PR for testing. 🐧 Linux AppImage buildsDownload a Linux AppImage build of this PR for testing. 🪟 Windows buildsDownload a Windows build of this PR for testing. |
This change adds a small push-queue mechanism to QFieldCloudConnection so that when the device is offline (or reachability is not confirmed), project push requests are queued and automatically retried once the connection becomes reachable again.
Uses QNetworkInformation::Reachability to detect online/offline transitions
Introduces queueProjectPush(), tryFlushQueuedProjectPushes() in QFieldCloudConnection
Emits queuedProjectPush(projectId, shouldDownloadUpdates) when flushing, and QFieldCloudProjectsModel listens to it to trigger projectPush()
Keeps behavior unchanged when no reachability backend is available (falls back to “online”)
trim.B5710F20-5268-4E78-8300-522A412331F3.MOV