aw-server icon indicating copy to clipboard operation
aw-server copied to clipboard

Started drafting really basic sync

Open ErikBjare opened this issue 7 years ago • 4 comments
trafficstars

~~This will be slow, it will be computationally expensive~~, it won't allow two-way sync of buckets (the host that created the bucket will always be authoritative), but it'll work.

  • [x] Requires: https://github.com/ActivityWatch/aw-server/pull/41
  • [x] Requires: https://github.com/ActivityWatch/aw-core/pull/69
  • [x] Requires: https://github.com/ActivityWatch/aw-core/pull/77
  • [x] Requires: https://github.com/ActivityWatch/aw-client/pull/42

ErikBjare avatar Aug 20 '18 21:08 ErikBjare

I'd be really interested in seeing this (by the way, I absolutely love this project! thank you so much!).

I'd been thinking of implementing some API-based sync on my own... i.e. a script that connects to the API on 2 different hosts and copies all events that don't exist from host A to host B a bucket at a time. But if there's going to be some sort of official upstream support for syncing, I'd rather use that.

jantman avatar Jan 17 '19 22:01 jantman

IMO this would be best as a seperate module running in parallel with aw-server and the aw-watchers. It doesn't look to actually require to be inside aw-server?

johan-bjareholt avatar May 06 '19 12:05 johan-bjareholt

@johan-bjareholt Indeed, I'm planning on rewriting it in Rust when I'm done prototyping.

Since the synced SQLite databases need to be consistent, and the SQLite datastores in Python and Rust aren't compatible (and shouldn't need to be), the Rust implementation will become the canonical one.

ErikBjare avatar May 06 '19 16:05 ErikBjare

Just thought I'd mention: I've since implemented it in Rust, and it works, but has a few bugs left. See https://github.com/ActivityWatch/aw-server-rust/tree/master/aw-sync

ErikBjare avatar Jan 14 '23 16:01 ErikBjare