ericberman / MyFlightbookWeb

The website and service for MyFlightbook
48 stars 18 forks source link

Feature to configure frequency of backups #2

Closed ericberman closed 6 years ago

ericberman commented 6 years ago

If you don't fly all that often, nightly backup may just mean more clutter.

theDonM commented 6 years ago

Possibly add an option for "Backup only if changes since last backup"

ericberman commented 6 years ago

Actually hard to do that.

there are two ways you could implement it: (a) set a "dirty" flag on your logbook when something changes and only back up if it's dirty, or (b) generate the backup and compare it to the last backup.

I actually have a version of the first based on add/modify/delete of your logbook (tells me if achievements need to be recomputed), but the problem is that other external changes can affect your logbook in subtle ways. E.g., suppose someone adds a flight using a Boeing 737, but the variant of 737 they use was missing the "Jet" flag in the database; I might fix that as admin, and this doesn't touch the logbook directly, but because the model definition changed, the turbine time in their backup and totals changes. So catching all of that is hard.

The 2nd option is more doable. At the moment, I don't request read permissions from the cloud provider, though I could add that. But the bigger issue is that if I'm already generating the backup, and then reading the prior backup (which could have been modified or deleted) and then optionally writing it anyhow, why not just overwrite it?

So that's what I implemented on March 10 (issue #65). I think it's actually a cleaner solution; this bug should be resolved as a duplicate since the fix for issue #65 really made this one moot.