Skip to content

feat(cloud): immediate sync on login + live Syncing status feedback#19

Merged
proofofprints merged 1 commit into
mainfrom
feat/cloud-sync-feedback
Jun 7, 2026
Merged

feat(cloud): immediate sync on login + live Syncing status feedback#19
proofofprints merged 1 commit into
mainfrom
feat/cloud-sync-feedback

Conversation

@proofofprints
Copy link
Copy Markdown
Collaborator

Why

After login, "Last sync" stayed blank for up to ~60s — login only enqueued a snapshot, and the sync loop is a 60s ticker. The Syncing status enum existed but was never set, so the user got no feedback that anything was happening.

Fix (cloud/)

  • Add login_notify (tokio::sync::Notify) to CloudState. cloud_login notifies it after enqueueing, and the sync loop select!s on the 60s tick or this signal — so login triggers an immediate cycle (mirrors the poller's force_poll).
  • Set status = Syncing while a snapshot/miners push is in flight in sync.rs; success flips to Connected.
  • cloud_login sets Connecting; an end-of-cycle guard settles any leftover Connecting/SyncingConnected (so a login with no data to push still resolves cleanly). AuthRequired/Error states are preserved.

UI

No change needed — CloudSyncPanel.tsx already maps syncing → pulsing dot and connecting → amber.

Verification

  • cargo check ✅ · npx tsc --noEmit
  • Runtime: user to confirm the status pulses Connecting → Syncing → Connected and "Last sync" updates within a second or two of login (not ~60s).

After login the 'Last sync' time stayed blank for up to ~60s (login only
enqueued; the sync loop is a 60s ticker) and the Syncing status enum was
never set.

- Add login_notify (tokio Notify) on CloudState; cloud_login notifies it
  so the sync loop runs an immediate cycle (mirrors poller force_poll).
- Sync loop select!s on the 60s tick or the login signal.
- Set status=Syncing while a snapshot/miners push is in flight; success
  flips to Connected. Login sets Connecting; an end-of-cycle guard settles
  any leftover Connecting/Syncing to Connected (auth/error preserved).

Frontend already maps syncing -> pulsing dot, so no UI change.
@proofofprints proofofprints merged commit 5521c43 into main Jun 7, 2026
1 check passed
@proofofprints proofofprints deleted the feat/cloud-sync-feedback branch June 7, 2026 05:11
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.

1 participant