chore: let user know about 429 status (#2747)
This commit is contained in:
@@ -100,6 +100,7 @@ import { ContentType } from '@standardnotes/domain-core'
|
||||
|
||||
const DEFAULT_MAJOR_CHANGE_THRESHOLD = 15
|
||||
const INVALID_SESSION_RESPONSE_STATUS = 401
|
||||
const TOO_MANY_REQUESTS_RESPONSE_STATUS = 429
|
||||
const DEFAULT_AUTO_SYNC_INTERVAL = 30_000
|
||||
|
||||
/** Content types appearing first are always mapped first */
|
||||
@@ -1000,6 +1001,10 @@ export class SyncService
|
||||
void this.notifyEvent(SyncEvent.InvalidSession)
|
||||
}
|
||||
|
||||
if (response.status === TOO_MANY_REQUESTS_RESPONSE_STATUS) {
|
||||
void this.notifyEvent(SyncEvent.TooManyRequests)
|
||||
}
|
||||
|
||||
this.opStatus?.setError(response.error)
|
||||
|
||||
void this.notifyEvent(SyncEvent.SyncError, response)
|
||||
|
||||
Reference in New Issue
Block a user