isPermanentSyncStatus function
Whether a status code means "do not retry this payload".
Implementation
bool isPermanentSyncStatus(int status) {
if (status == 408 || status == 429) return false;
if (status >= 500) return false;
return status >= 400;
}