Skip to content

feat(android): add Google Drive history sync - #21

Open
Epikaigle wants to merge 1 commit into
avinaxhroy:mainfrom
Epikaigle:feat/android-google-drive-sync
Open

Epikaigle wants to merge 1 commit into
avinaxhroy:mainfrom
Epikaigle:feat/android-google-drive-sync

Conversation

@Epikaigle

Copy link
Copy Markdown
Contributor

Summary

Adds optional cross-device listening history synchronization via Google Drive appDataFolder for the Android app, matching the protocol implemented in the companion browser extension (#20).

This allows listening activity from Android and paired browser extensions to sync seamlessly over Google Drive without any external Tempo servers.

What Changed

  • Google Drive transport: AppData background sync client using least-privilege drive.appdata scope.
  • Database schema (Room v58):
    • Added migrations 55->56->57->58.
    • Added listening_event_origins table to track exact producer aliases per Google account.
    • Added drive_account_subject column to listening_events to isolate history by Google account.
  • Background synchronization: Periodic DriveHistorySyncWorker (runs every ~6 hours and on-demand).
  • Settings UI: Dedicated DriveHistorySyncSection in Backup & Restore settings with separate toggle, status, manual sync, and cloud history deletion controls.
  • Provenance safety: Preserves stable origin IDs for LAN scrobble ingestion to eliminate publication loops.
  • Unit & platform tests: Comprehensive tests for protocol encoding, Room migrations, cursors, account isolation, and reconciliation.

- Add optional cross-device listening history synchronization via Google Drive appDataFolder
- Implement Room migrations 55->56->57->58 for durable origin aliases and account scoping
- Add background synchronization via WorkManager (DriveHistorySyncWorker)
- Add Google Drive history sync UI section and viewmodel in Settings
- Preserve origin provenance for LAN scrobble ingestion to prevent publication loops
- Add comprehensive unit tests for protocol, migrations, cursors, and account boundaries
@avinaxhroy

Copy link
Copy Markdown
Owner

Thanks for all your contributions to Tempo, @Epikaigle ! I really appreciate the time and effort you’ve put into the project.

I’m going to close this PR, as I plan to build multi-device and cloud sync myself as part of Tempo’s roadmap, potentially as an optional paid add-on separate from the free core. Read our CONTRIBUTION.md.

We can talk on this topic and any topic regarding tempo if you want, my Discord- mrstevenofc

@Epikaigle

Epikaigle commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for your reply @avinaxhroy !

The main reason I implemented Google Drive sync is that my computer is connected via Ethernet, while my phone uses 4G. I don't use Wi-Fi at home, so my browser extension and Android app are never on the same local network, which makes the existing LAN synchronization unusable for me.

That's why I was looking for a way to sync my listening history across devices without relying on a local network.

Since you're planning to develop multi-device/cloud sync yourself, I was wondering if you already have an estimated timeline for its release. Is this something you're planning to introduce soon, or is it more of a long-term feature?

Thanks again!

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