Charm
Charm copied to clipboard
Make "Bill Lumbergh" reminder use lotsofcake REST API
Instead of remembering locally which timesheets have been submitted (which fails when more than one installation is used), retrieve the information from lotsofcake directly, using its REST API.
But what should happen then, when I'm travelling on a Monday, without internet access? Charm won't be able to ask the server, so it will have to take a guess. Will it guess safely (no internet = I assume you didn't upload) or skip the check (bad)? I guess the best solution is a local cache of what the server said the last time we asked it, and, when not connected to the internet, using the cache instead.
If there's unuploaded local events past their "due date", it could just warn you about them not being uploaded yet. Assuming that all tracked events are supposed to be uploaded, in a lotsofcake-enabled installation, one wouldn't need any online check at all for that. Right now the problem is that the "weeks uploaded" flags are stored in the settings, separated from the events (which are in the sqlite db). So moving charm databases across installations doesn't work properly. If we add the flags to the db, it should be always consistent.
The online check via the REST API would be just a "global" reminder that at least one timesheet needs to be uploaded.
Oh OK. Then the main reminder for people using a single computer is the first one, not the second one.
To avoid strange interactions, the online check via REST should probably not even happen if there are local unuploaded events past their due upload date. It's pointless then, this instance of Charm knows there are things to upload ;)