Skip to content

Conversation

@avelino
Copy link
Contributor

@avelino avelino commented Sep 30, 2025

  • Introduce frontend.mobile.sync-background namespace to manage cloud sync when the mobile app is backgrounded.
  • Track app state, network connectivity, and background sync status using atoms.
  • Provide functions to handle app state and network changes.
  • Ensure sync only triggers when app is backgrounded, network is connected, and sync is enabled.
  • Integrate with storage and state modules for sync control.

This enables reliable background syncing for mobile users, improving data consistency and user experience.

ref: https://discuss.logseq.com/t/logseq-mobile-sync-in-background/17214

- Introduce `frontend.mobile.sync-background` namespace to manage cloud sync when the mobile app is backgrounded.
- Track app state, network connectivity, and background sync status using atoms.
- Provide functions to handle app state and network changes.
- Ensure sync only triggers when app is backgrounded, network is connected, and sync is enabled.
- Integrate with storage and state modules for sync control.

This enables reliable background syncing for mobile users, improving data consistency and user experience.

ref: https://discuss.logseq.com/t/logseq-mobile-sync-in-background/17214

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
…emSynchronizedGroupsEnabled to true in the preferences.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino avelino changed the title feat(mobile): add background cloud sync for mobile app WIP: feat(mobile): add background cloud sync for mobile app Sep 30, 2025
- Added iOS background task registration and scheduling in AppDelegate.swift using BGTaskScheduler.
- Integrated background sync trigger via JavaScript bridge to webview.
- Ensured background sync is scheduled on app launch and when entering background.
- Updated Info.plist to support background tasks and required capabilities.
- Exposed background sync trigger to JS global in sync_background.cljs for iOS bridge.
- This enables Logseq mobile to sync notes in the background, improving reliability and user experience.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
- Add RECEIVE_BOOT_COMPLETED permission to AndroidManifest.xml
- Add MobileSyncService and MobileSyncBootReceiver for background sync
- Update MainActivity to support background sync triggers
- Enables background sync to run periodically and after device boot

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino avelino changed the title WIP: feat(mobile): add background cloud sync for mobile app feat(mobile): add background cloud sync for mobile app Sep 30, 2025
@avelino
Copy link
Contributor Author

avelino commented Sep 30, 2025

@tiensonqin and @logseq-cldwalker see if this implementation makes sense for logseq's future

@vmesel
Copy link

vmesel commented Oct 2, 2025

it will make my life better on the mobile app

@vmesel
Copy link

vmesel commented Oct 7, 2025

@logseq-cldwalker @tiensonqin any updates here?

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.

2 participants