Skip to content
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

Chunking the syncing process to less than 400 ops/request still leads to error: ErrorHandler.Chunk: Limit Exceeded: the request to the server is too large.CKError.Code: 27 #143

Open
jamesryu108 opened this issue Jun 13, 2019 · 2 comments · May be fixed by #175
Assignees

Comments

@jamesryu108
Copy link

jamesryu108 commented Jun 13, 2019

Expected behavior

I am inside of syncRecordsToCloudKit function of SyncEngine class. Inside the completion block called modifyRecordsCompletionBlock of modifyOpe, chunkItUp function is used to request less than 400 operations on a single request:

            let chunkedRecords = recordsToStore.chunkItUp(by: 300)
            print("CHUNKING BY: \(chunkNumber)")

            for chunk in chunkedRecords {
            print("chunk: \(chunk.count)")
                self.syncRecordsToCloudKit(recordsToStore: chunk, recordIDsToDelete: recordIDsToDelete, completion: completion)
            }

This should sync data 300 ops at a time without a problem.

Actual behavior(optional)

However, I get an error message as if I went over 400 operations per request:

ErrorHandler.Chunk: Limit Exceeded: the request to the server is too large.CKError.Code: 27

output:
CHUNKING BY: 300
chunk: 300
chunk: 300
chunk: 157

This problem results in not even single data being synced to the iCloud. How do we bypass this problem?

@caiyue1993 caiyue1993 self-assigned this Jul 20, 2019
@gghanak
Copy link

gghanak commented Nov 21, 2019

Seems like the missing piece of the puzzle is chunking the recordIDsToDelete as well ...

@caiyue1993 caiyue1993 linked a pull request Nov 24, 2019 that will close this issue
@caiyue1993
Copy link
Owner

caiyue1993 commented Nov 24, 2019

Hi @jamesryu108 and thanks to @gghanak, I've proposed #175 to fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants