Files
breeze/tests/sync_retry_c_boundary_test.c
T
waozi f07f0e16c9 Keep syncing automatically after a rejected sign-in
When two sign-ins of one account overlapped right after an account was
attached, the server rejected one, and Inner Breeze stopped syncing until the
person reconnected by hand: the username and new sessions stayed on the
device. A rejected sign-in is now retried with a fresh challenge on the usual
schedule while the account key exists, and the sync status still shows the
failure until a sync succeeds.
2026-10-04 20:33:10 -03:00

18 lines
619 B
C

#include "sync_result.h"
#include "sync_retry.h"
#include <limits.h>
int
main(void)
{
RetryDecision retry = sync_retry_decision(SyncResult_SYNC_REQUEST_FAILED, 0);
RetryDecision signin = sync_retry_decision(SyncResult_SYNC_AUTH_FAILED, INT_MAX);
RetryDecision stop = sync_retry_decision(SyncResult_SYNC_SIGN_FAILED, INT_MAX);
return retry.attempt == 1 && retry.delay == 5 && !retry.needs_action &&
signin.attempt == 4 && signin.delay == 60 && !signin.needs_action &&
stop.attempt == 4 && stop.delay == 0 && stop.needs_action &&
app_sync_retry_delay(INT_MIN) == 5.0 ? 0 : 1;
}