Closed undefiened closed 1 year ago
Thank you very much for fixing it and showing me how it should be done instead of simply fixing it! I am not very familiar with Kotlin, so I got scared when I attempted to use "const" and it said something about companion objects :) So I am very thankful for the learning opportunity.
I added an exception to the Google Drive sync process in case the user hasn't logged in to Google Drive.
Before my changes syncing via Google Drive didn't generate any errors if the user hadn't logged in. The bug is easy to reproduce:
Then the sync happily reported that 0 errors were generated even though nothing actually was synchronized because Google Drive wasn't even signed in.
I also added exceptions in a couple of other places, since they are supposed to be treated as a failure anyway. As far as I understand,
SyncDataJob
reports that sync was successful if no exceptions were generated during it, so I think it probably makes sense to put exceptions everywhere. From a bigger point of view it would have probably made more sense to makeSyncDataJob
work the other way around: to assume failure by default, unless the syncing process reported success, but I am not sure how it can be done.I also moved redirect url into a constant so that it is in one place.