Under consideration

:bulb:

Sync across multiple PCs using services like Google Drive and Dropbox

You cannot currently sync Foreground across multiple PCs because one of the reasons I had for making it was to make sure that tracking data was private and secure on your PC, and not available to me or anyone else.

However, I have been thinking about a way to opt in to syncing across devices. Essentially, you’d choose the cloud-storage folder of your choice on your PC, whether that’s Dropbox, Google Drive, OneDrive, whatever, and each PC running Foreground would write a unique copy of its database there, and the others would read each database and merge all entries. In this way, each version would have the full set of records across all PCs. As an added benefit, then you could turn on syncing to Exist on any one of these PCs (and one only), and it would sync totals from all PCs.

I’m not entirely sure of the easiest way to do this with SQLite, but if there are no extensions or tools for it, there’s nothing stopping me from just doing it with SQL.

I am very happy to take feedback on this approach and hear alternative proposals!

3 votes

Tagged as New feature

Created 08 October by Josh Sharp

  • Sign in to comment and vote. Sign in by email
  • 08 October Josh Sharp created this task

  • avatar

    Thanks for adding this task, Josh!

    I have Foreground installed on my home laptop and my work laptop, and I currently sync Productive and Neutral time from work only and Gaming from home only.

    I was able to install Foreground on my work laptop only because I work in IT; most people at my work don’t have admin rights to their work laptops for security reasons. That said, I don’t have native access to my personal OneDrive or Google Drive from my work laptop, and that’s not something that IT Security is likely to budge on. So, the shared cloud storage option wouldn’t work for me, unfortunately, although I’m probably an outside case.

    I work in data modeling and visualization, not app development, but any ideas I’ve had about how multiple instances of Foreground could sync to Exist without overwriting would likely require more rework than it’s worth.

    12 October
  • avatar

    I agree with Diana, care less about machines syncing with each other and more about tracking my time across all my devices. I feel like Exist accepting aggregate data from each client might be a more straightforward approach than relying on syncing which adds another failure point and makes offline use more complicated.

    26 November
  • avatar

    This is a solution for Exist being able to accept totals from multiple PCs, though. It’s not really possible to make it easier from the Exist end. The only alternative I can think of would be syncing Exist totals from your multiple PCs to a Foreground server that aggregates them before sending the total to Exist. But this also introduces a needless server component rather than letting you just use your existing “cloud storage” service.

    As mentioned in the Exist forum, we can’t just send increments to Exist (rather than a total) and trust that they’ll tally to the correct number, because these can never be overwritten. So for example if you had an uncategorised app you used one day that you then set to productive, we’d later send that time as productive but be unable to clear the now-incorrect neutral time.

    I’m open to suggestions on alternative setups though :) maybe someone will come up with something.

    26 November
  • avatar

    I have recently been using an app called Diarium (https://forum.diariumapp.com/d/13-sync), which syncs multiple databases through cloud storage, that is very similar to your idea. I am very much looking forward to the completion of cross-PC synchronization functionality.

    When syncing, there’s a point to consider. If two PCs have different classifications for the same app, can their respective settings be retained? For instance, if PC1 defines Google as focus time while PC2 defines Google as neutral time, can both sets of data be kept separately during synchronization? Or should they be unified under a single definition?

    28 November
  • avatar

    Hmm, I think it would make sense to sync the classification for apps & sites so that it’s the same across all your installs. I can imagine issues arising from them being classified differently on different machines… but it might be possible.

    28 November
  • avatar

    While I’ve been thinking about it, there’s really two parts here:

    1. Syncing all data so each PC knows about all your time across all PCs
    2. Syncing to Exist, so Exist knows about all time in selected attributes across all PCs

    It would be significantly easier to solve #2 by, for example, syncing all your PCs to an in-between Foreground server that then sends Exist one big total for each day. You wouldn’t notice anything different, it’d just be that you could sync totals to Exist that cover all PCs — but each one would only know about its own data locally. So to be clear, is there anyone who wants #2 but doesn’t need #1?

    Monday
  • avatar

    I prefer option #1 to track total time across devices. I use my personal PC for work when WFH, and that productivity isn’t tracked.

    Categorizing apps differently by context (e.g., Discord as productive at work but neutral at home) would make totals more accurate. Profiles for switching between “Work” and “Personal” modes could help, though it might add complexity.

    Thursday