-
Notifications
You must be signed in to change notification settings - Fork 73
Handle 'quotaExceeded' errors #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| /// This method can be called many times, and so you will want to de-duplicate the | ||
| /// `quotaExceeded` boolean so as to not alert your users multiple times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should also have a quotaExceeded: Bool observable value on the SyncEngine? That would allow showing/hiding a banner in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be very handy!
|
I'm converting this to a draft because currently I'm not entirely sure how we can be notified of |
| func syncEngine( | ||
| _ syncEngine: SyncEngine, | ||
| quotaExceeded: Bool, | ||
| scope: CKDatabase.Scope | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we surface the record/participant/CKShare that is responsible for the error?
If the user runs out of iCloud storage, saving records will report a
.quotaExceedederror. Currently we are not handling that error correctly. Those updates will never be retried again later (unless the record happens to be edited later). And there is currently no way for the user of our library to be notified of such errors so that they can let the user know that there is something for them to fix. This PR addresses both of those problems:.quotaExceedederror we not save the record ID to thePendingRecordZoneChangestable, which means they will be re-enqueued whenever the sync engine starts again. This will give the records a chance to save again at a later time.sendChangesmethod is every explicitly called on the sync engine..quoteExceedederror.