Skip to content

Skip remote-interval polling for accounts with an active push channel #185

Description

@gnacho

The official client uses push notifications as the source of truth and only polls ETags for folders whose account has NO working push channel. FolderMan::slotEtagPollTimerTimeout (src/gui/folderman.cpp:1131) filters:

std::copy_if(..., [](Folder *folder) {
    const auto account = folder->accountState()->account();
    return !pushNotificationsFilesReady(account);
});

So a folder with live push is never polled on the interval; polling is the fallback for accounts without push.

Current state in nextsync-rs: scheduler.rs arms RemoteInterval whenever remote_interval_enabled is on (scheduler.rs:1185-1190), with no knowledge of whether the account push channel is connected. Every interval fires a full RemoteInterval sync for every folder even when notify_push is delivering changes in real time. Wasteful: a full reconciliation each remote_interval_minutes on top of real-time push.

Proposed work:

  1. Let the account runtime tell the folder schedulers whether the push channel is ready (the push client already emits state via store_push_state).
  2. In request(), downgrade/skip RemoteInterval while push is ready for that account (keep RemotePush as the real-time trigger).
  3. Keep RemoteInterval as the fallback when push is disabled, not offered, or disconnected (matches the official behaviour and our OpenCloud accounts, which have no push).

Related: #183 (file-id resolution) shares the goal of not re-syncing folders with no changes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions