It might be that clients are rejected by the BE if they trigger too many requests within a threshold, or server is a teapot. In that case we want to warn the user if 10 consecutive calls are rejected, or if after a failure there is no success sync in 12h. (notified once per day)
Steps to test this PR
Feature 1
[x] Fresh install
[x] create a sync account
[x] no errors, no notifications
[x] add a bookmark or a credential
[x] no warnings visible
[x] (enable notification permissions)
[x] apply patch attached to Asana and install
[x] opening the app will trigger sync (it has started failing, hold on)
[x] if you wait a few seconds you will get a notification (the scheduled worker in the patch has 12 seconds delay)
[x] ensure you got a notification
[x] Go to sync settings, ensure there's a warning "sync & backup is temporarily unavailable"
[x] discard patch and install app
[x] when opening the app, sync will succeed
[x] Ensure warning is gone
( optional tests)
[ ] disable sync
[ ] enable sync again (just to start from a clean state, so we see the notification)
[ ] apply patch again, but discard the change in RealSyncUnavailableRepository using HOURS instead of Seconds
[ ] update the app
[ ] perform actions until you hit 10 failures on sync
[ ] At some point you get a notification and validate warning is in settings
Task/Issue URL: https://app.asana.com/0/1149059203486286/1207374369607209/f
Description
It might be that clients are rejected by the BE if they trigger too many requests within a threshold, or server is a teapot. In that case we want to warn the user if 10 consecutive calls are rejected, or if after a failure there is no success sync in 12h. (notified once per day)
Steps to test this PR
Feature 1
( optional tests)
RealSyncUnavailableRepository
using HOURS instead of SecondsUI changes