Skip to content

Conversation

@kaustuvpokharel
Copy link
Collaborator

@kaustuvpokharel kaustuvpokharel commented Dec 12, 2025

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

…push the changes as soon as the network is available
@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Dec 12, 2025

Copy link
Contributor

@github-actions github-actions bot left a 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;
Copy link
Collaborator

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()

Copy link
Collaborator Author

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 😄

@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Dec 16, 2025

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 53d278a)

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 53d278a)

🪟 Windows builds

Download a Windows build of this PR for testing.
(Built from commit 53d278a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants