ground-android
ground-android copied to clipboard
[Code health] Catch only transient errors for retry in PhotoSyncWorker
From https://github.com/google/ground-android/pull/404#discussion_r396719499
@scolsen, "it might make sense to fail against certain exceptions—not sure precisely what exceptions that function can throw, but I imagine there may be some cases that are unrecoverable, in which case it doesn't make sense to continue retry work."
The number of retries is bounded, so even unrecoverable errors will cause photo upload to be aborted (eventually).
The number of retries is bounded, so even unrecoverable errors will cause photo upload to be aborted (eventually).
True, I don't think it's high priority for precisely that reason, but it feels wasteful for us to attempt any number of retries for cases which we know will never succeed, e.g. unsupported photo file type (which should happen rarely, if ever, in the first place) I think is one failure case in which it makes no sense for us to mark the work for retry as it will fail every time (the file extension for that particular unit of work will remain stable while we attempted to needlessly process it N times — that's N potential DB writes, etc. that would be happening for no good reason).
Fair point. After all, this is a tagged as "code health", not "bug", in which case I think we could keep it open.
Removing "Done" status based on conversation above