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

Error Domain=QSCloudKitSynchronizerErrorDomain Code=0 "(null)" #69

Closed
spotlessicode opened this issue Nov 20, 2018 · 4 comments
Closed

Comments

@spotlessicode
Copy link

Hello,

Could you help please, I always got this error:
Error Domain=QSCloudKitSynchronizerErrorDomain Code=0 "(null)"

if not, the sync is running without the completion block. So
Here nothing called in the completion block, or just got this error:

[self.synchronizer synchronizeWithCompletion:^(NSError *error) {
                    //  [self.indicatorView stopAnimating];
                    NSLog(@"Sync Start");
                    NSLog(@"error %@", error);
                    if (error) {
                        NSLog(@"error snyc end: %@", error);
                    }else{
                         //CHECK SYNCKIT SUBSCRIBES!!!!
                        NSLog(@"Sync END check Zone ID");
                    }

2018-11-20 14:14:43.579750+0100 error Error Domain=QSCloudKitSynchronizerErrorDomain Code=0 "(null)"
2018-11-20 14:14:43.579932+0100 Purp[43018:2262975] error snyc end: Der Vorgang konnte nicht abgeschlossen werden. (QSCloudKitSynchronizerErrorDomain-Fehler 0.)

And I can't see the saved objects in the TableView, just after I launch the App again. (Checked saved in the ManagedObjectContext, and I can log them out, but fetch controller can't recognize it.. Without sync, and the AdapterImport there is no problem.

And sometimes the app is crashing at QSCoreDataAdapter if the sync completion not called
2018-11-20 14:14:40.397866+0100 Purp[43018:2263064] <0x282125340 QSCoreDataAdapter.m:(139)> ADAPTER savePrivateContext

Do you have any idea? I have already checked the developer team at signing, so it has an access to the CloudKit, prov.profile has the CloudKit container, which is the same as in the code. Maybe I miss something, an idea can help to overcome.

Thank you!

Eva

@spotlessicode
Copy link
Author

1. Sync completion Block

I have found, that you call completionBlock, just if error isn't nil
So I tried, in QSCloudKitSynchronizer.m
- (void)finishSynchronizationWithError:(NSError *)error
after
QSCloudKitSynchronizerDidSynchronizeNotification
I added:
NSError *error2 = nil;
callBlockIfNotNil(self.completion, error2);

and at my App side in AppDeleagte.m
[self.synchronizer synchronizeWithCompletion:^(NSError *error) {

if((!error)||([error isEqual:[NSNull null]])){ NSLog(@"No error"); }else{ NSLog(@"error snyc end: %@", [error localizedDescription]); }

2. Table update /FRC update after sync
At the table update.. IT doesn't work after I commented out sync after creating object.. But at a clean start without any data, it works, until I call first time the self.synchronizer synchronizeWithCompletion strange. I test it more.

3. QSCloudKitSynchronizerErrorDomain Code=0
Int he last 2 hours there were nor Error Domain=QSCloudKitSynchronizerErrorDomain Code=0 "(null)" errors. But if you know, when it's happening/the meaning, please let me know.

@spotlessicode
Copy link
Author

1. Sync Completion Block

  • should I check if sync ends, for subscribing with ZONEID data changes, so the device B will know, if it changed? (Or based on your wiki, we shouldn't).
  • any other mode to be notified, if sync ends?

2. FRC
(NSFetchedResultCotnroller can't see the objects if I start sync after save and unwind)
I couldn't solve this problem in the last hours.. everything is perfect without synchronization.

3. QSCloudKitSynchronizerErrorDomain Code=0
I have again this issue but just sometimes..(when it comes, sync doesn't run, so FRC works) What causes this? could it be a poor internet connection? or what else? How could we get more error info?

@mentrena
Copy link
Owner

Hi,

I'm trying to understand the problem, let's see.

QSCloudKitSynchronizerErrorDomain Code=0

I believe that's QSCloudKitSynchronizerErrorAlreadySyncing (definition in QSCloudKitSynchonizer.h)
Which means that your app is already in the process of synchronising data with CloudKit.
The first caller of synchronizeWithCompletion will have its completion block called when sync finishes. Successive callers will immediately receive the "already syncing" error.

So yes, it could be due to a poor connection.
Could you clarify these two things:

  • The first time you call synchronizeWithCompletion you don't get that error./
  • After you call it a second time and you get the error, can you confirm that the synchroniser is still trying to sync? (by pausing with the debugger, or looking at the debug lines being printed)

@spotlessicode
Copy link
Author

spotlessicode commented Nov 22, 2018 via email

@mentrena mentrena closed this as completed Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants