Git Product home page Git Product logo

ticoredatasync's People

Contributors

chbeer avatar chronicstim avatar dannygreg avatar dannysgithubtest avatar dhennessy avatar kevinhoctor avatar timisted avatar tonyarnold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ticoredatasync's Issues

What are the best practices before integrating TICoreDataSync?

Hi Guys thanks you for sharing such an awesome code..

I have a core data App, which I am going to submit in app store.I have plans for integrating TICoreDataSync in the next Update.So what are the precautions should I take before submitting the App..?Do I need to put some code in the core data part in behalf of TICoreDataSync, so that the future integration goes smoothly..?

Kind regards
Tonku

Deletion changes are not recorded for unsaved objects

If an object is inserted by client A, synced to client B, and immediately deleted by client B, no sync change is created by client B for that object.

The workaround is to save the managed object context in client B when it receives the Document Sync Manager delegate message:

- (void)documentSyncManager:(TICDSDocumentSyncManager *)aSyncManager didMakeChangesToObjectsInBackgroundContextAndSaveWithNotification:(NSNotification *)aNotification

Crash after core data save, after configuring docSyncManager

I have my app set up the core data store and then configure the app then doc sync managers. After that, when I save new data to the store, it crashes. If i take out the configuring of the doc sync manager, it doesn't crash.

Any thoughts as to why it might be crashing? The crash doesn't give an error, and I have everything other than 'Guard Malloc' selected in Diagnostics. Someone suggested it might be related to accessing the context on multiple threads, but my code uses the main thread.

WholeStore is empty

When I first started working with this library, I was able to get syncing to work - initially. There was a file stored in the WholeStore directory at that time. During troubleshooting a crash - I removed the contents of the Dropbox folder and reinstalled the app on the device. Now, WholeStore exists but remains empty and no syncing ever happens (not an initial download or any updates). Nothing syncs across devices. I'm testing this in the simulator (5.0 and 5.1).

Any ideas?

help in the tutorial.

it's the first time i try this lib, so i try to follow this tutorial: http://timisted.github.com/TICoreDataSync/ios-tutorial.html (i try the one for mac too), but i can't find how to do to install it (in the Notebook project located in tutorial folder), in the tutorial the author say that we have to add the folder TICoreDataSync to the project which have 6 folder and a .h file, but the last repo have 7 folder.
other thing, the " /Examples/External /Examples/External Sources/DropboxSDK " dos not exist and now the DropboxSDK is located in the "07 External Frameworks".
i try to configure it with some combination without luck.
can you help for ios and mac? thank you.

iOS Tutorial on Polling Start

In the iOS Tutorial it says:


Enable Automatic Synchronization After Changes are Detected:

You’ll need to turn on remote change polling immediately after the document sync manager has finished registering, so add the following into the relevant delegate method:

  • (void)documentSyncManagerDidFinishRegistering:(TICDSDocumentSyncManager *)aSyncManager
    {
    ...
    [aSyncManager beginPollingRemoteStorageForChanges];
    }

If the whole stores need to be downloaded this causes the sync changes to be downloaded and "applied" before the whole store is downloaded - causing some of those changes not be applied. I was mainly seeing the problem for deletions. It could also be due to how I have application structured. My own documentSyncManagerDidFinishRegistering: method is as follows:

(this is after I changed it so that it works correctly for me)

  • (void)documentSyncManagerDidFinishRegistering:(TICDSDocumentSyncManager *)aSyncManager
    {

    if (self.shouldDownloadStoreAfterRegistering) {
    [aSyncManager initiateDownloadOfWholeStore];
    } else {
    [aSyncManager initiateSynchronization];

    [self.documentSyncManager beginPollingRemoteStorageForChanges];
    

    }

    self.documentSyncManagerReady = YES;

    NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
    [ud setBool:YES forKey:OPTIONS_SYNC_WITH_DROPBOX_ON];

}

If a download of the whole stores is necessary I put [self.documentSyncManager beginPollingRemoteStorageForChanges] in documentSyncManagerDidFinishDownloadingWholeStore:.

Thanks!
Mazen

NSPersistentStoreCoordinator has no persistent stores

We're tracking an issue while syncing in MoneyWell where the app will crash with the following error logged:

2012-08-13 07:33:04.046 MoneyWell[5110:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores.  It cannot perform a save operation.'

This happens on both MoneyWell for iPhone and MoneyWell for Mac. We haven't been able to recreate this one in house and it's not an epidemic, but there are reports of it in the wild.

DocumentSyncManager initiates many syncs while files are downloaded

I'm using the new iCloud core data sync from the branch. After I installed the app fresh on a device, while there are some changes in the cloud, it takes a very long time until the sync finishes.

While debugging, I see that the synchronization is initiated many times in this method, which is called when a file changes:

- (void)directoryContentsDidChange:(NSNotification *)aNotification
{    
    NSString *aPath = [[aNotification userInfo] valueForKey:kTIKQExpandedDirectory];

    if( ![[aPath lastPathComponent] isEqualToString:TICDSSyncChangesDirectoryName] ) {
        // another client has synchronized
        [self initiateSynchronization];
        return;
    }
    ...

This results in:

2013-04-09 14:49:50.077 iVocabulary3[2146:907] -[TICDSDocumentSyncManager startPreSynchronizationProcess] : Starting pre-synchronization process
2013-04-09 14:49:50.083 iVocabulary3[2146:907] -[TICDSDocumentSyncManager startSynchronizationProcess] : Starting synchronization process
2013-04-09 14:49:50.099 iVocabulary3[2146:907] -[TICDSDocumentSyncManager startPreSynchronizationProcess] : Starting pre-synchronization process
[...many times more ...]

Is this maybe a new problem using iCloud sync?
What should be the correct behavior?

Should the directory maybe only change if created the first time (if not on iCloud)? Maybe iCloud handles this differently?

Thanks for your help,
Christian

TICoreDataSync is not finding updates when there are updates.

I have setup the project as instructed in the docs (except that I updated to the latest Dropbox SDK and link process).

My app syncs the whole store uploads and downloads just fine. However, no matter how much I change the data, it does not find any changes to sync. I have added the extra field to each entity in the CoreData schema. I have the delegate methods all setup appropriately (AFAIK).

Below is my console output with TICoreDataSync debugging and CoreData SQL debugging turned on and a few extra NSLog statements.

 TICDSSynchronizedManagedObjectContext save
 CoreData: sql: BEGIN EXCLUSIVE
 CoreData: sql: SELECT Z_MAX FROM Z_PRIMARYKEY WHERE Z_ENT = ?
 CoreData: sql: UPDATE Z_PRIMARYKEY SET Z_MAX = ? WHERE Z_ENT = ? AND Z_MAX = ?
 CoreData: sql: COMMIT
 CoreData: sql: BEGIN EXCLUSIVE
 CoreData: sql: DELETE FROM ZPERSON WHERE Z_PK = ? AND Z_OPT = ?
 CoreData: sql: INSERT INTO ZPERSON(Z_PK, Z_ENT, Z_OPT, ZGROUP, ZBIRTHDATE, ZCREATEDAT, ZMODIFIEDAT, ZNAME, ZNOTE, ZREMOTEID, ZTICDSSYNCID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
 CoreData: sql: COMMIT
 CoreData: sql: pragma page_count
 CoreData: annotation: sql execution time: 0.0021s
 CoreData: sql: pragma freelist_count
 CoreData: annotation: sql execution time: 0.0017s
 TICDSSynchronizedManagedObjectContext saved
 -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : MOC saved, so beginning post-save processing
 -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Sync Manager will save Sync Changes context
 -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Sync Manager saved Sync Changes context successfully
 -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Asking delegate if we should sync after saving
 -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Delegate allowed synchronization after saving
 -[TICDSDocumentSyncManager startSynchronizationProcess] : Starting synchronization process
 -[TICDSDocumentSyncManager moveUnsynchronizedSyncChangesToMergeLocation] : Checking if there are local sync changes to merge and push
 -[TICDSDocumentSyncManager moveUnsynchronizedSyncChangesToMergeLocation] : No local sync changes need to be pushed for this sync operation

You can see that there are changes made to the CoreData data and yet TiCoreDataSync says "No local sync changes need to be pushed for this sync operation". This is the ONLY result I get at that point in the sync process. No matter what happens to the CoreData datastore, no changes are detected.

I am building this with XCode 4.5/Mountain Lion and running against an iPhone 4s/iOS 6 and iPod Touch 3rd Gen/iOS 5.1.

Automatic detection of changes (iCloud)

As [TICDSFileManagerBasedDocumentSyncManager enableAutomaticSynchronizationAfterChangesDetectedFromOtherClients] is no longer in use, how do you achieve automatic synchronization after changes are detected?

Hierarchy of parent-child NSManagedObjectContext

Hi Michael,

again mis-using this for a question. But this way all other users can see it as well.

Regarding the switch to parent-child managed object context: how do you structure the hierarchy?

I currently have set the NSMainQueueConcurrencyType-context to be synchronized. That leads to much work be done on the main thread by TICoreDataSync (or Core Data) when syncing changes.

Should I have a top-level managed object context that gets synched and a NSMainQueueConcurrencyType sub-context? In my tests this led to missing updates?

I merged your parent-child-conversion branch with Drew's extension for iCloud which works great so far.

Thanks and best regards,

Christian

When device is offline, application & document managers cannot register so no sync change sets are saved

  1. User's device is offline (e.g. airplane mode, or iPad without wifi connection).
  2. User opens app with TICoreDataSync integrated
  3. TICoreDataSync tries to register the application and document managers to set up the sync functionality
  4. Because the device has no internet connection, TICoreDataSync can't connect to Dropbox and can't locate the global directory or any other aspects of the files stored on the server -- so the application registration fails (making it so that document registration cannot begin)
  5. User uses the app, saving changes to the core data store
  6. Because there is no application or document manager, no changes to core data store are saved in change-set files
  7. User goes online and syncs, but since none of the offline changes were added to a change-set file, nothing is synced

Any solutions or ideas on how to resolve this problem?

Unrecognized selector crash

I'm hitting a crash in TICDSDocumentSyncManager.m:

- (void)vacuumOperation:(TICDSVacuumOperation *)anOperation failedToCompleteWithError:(NSError *)anError
{
    TICDSLog(TICDSLogVerbosityErrorsOnly, @"Vacuum Operation Failed to Complete with Error: %@", anError);
    [self ti_alertDelegateWithSelector:@selector(documentSyncManager:didFailToVacuumUnneededRemoteFilesWithError:), anError];
    [self postDecreaseActivityNotification];
}

Specifically the line calling TICDSLog(). The error passed through is an instance of NSError, but calling po on the object in LLDB returns:

Printing description of anError:
(NSError *) anError = 0x0bac0780
2012-07-24 23:12:25.325 AwesomeClientApp[5427:c07] +[TICDSFileManagerBasedVacuumOperation localizedDescription]: unrecognized selector sent to class 0x30a0b4

TICDS Operation persistence when an app is pushed to background state

During our testing of the framework between devices, we've seen instances where some changes are sync'd properly while others seem to have disappeared. I believe the problem may be related to when the TICDS operations are processing and when the app is pushed to the background by the user.

As an example, let's say on Device A I create a new diary entry (our app is a chronic pain tracking diary) and save this new entry. We currently have TICDS to sync following a new entry save, so when the entry is saved, the sync kicks off. Now, go to the Device B and open the app (we also have a sync kick off when the app starts) and that entry will pop up in our diary. Perfect.

But now change the scenario a bit and immediately following the save of the new diary entry on Device A, I tap the home button to push the app to the background. When I go to Device B, the new entry may or may not pop up. What's worse is that if I repeat this process of making an entry and backgrounding the app over and over (a normal use case), when I sync Device B I end up with a diary that contains some but not all of the entries from Device A.

What I think is happening, although we haven't dug in enough to verify, is that the sync process is being interrupted by the app going to the background and in some cases the next time the sync starts, it's not picking up the previously interrupted sync changes.

Does this make sense Tim/Michael? If so, do you have any recommendations about how to best implement TICDS to ensure that either operations continue past the backgrounding process and/or any interrupted sync operations are picked up and completed by a future sync operation.?

continueSynchronizationByResolvingConflictWithResolutionType: picks the wrong operation to resolve the conflict

This method

- (void)continueSynchronizationByResolvingConflictWithResolutionType:(TICDSSyncConflictResolutionType)aType
{
    TICDSSynchronizationOperation *operation = [[self.synchronizationQueue operations] lastObject];

    [operation setMostRecentConflictResolutionType:aType];

    [operation setPaused:NO];
}

picks the lastObject to solve the conflict. But looking at the operation, it seems it's the wrong one (breakpoint on second line in method):

(lldb) print [operation isPaused]
(BOOL) $4 = NO
(lldb) po [[self.synchronizationQueue operations] valueForKeyPath:@"isPaused"]
(id) $6 = 0x208c7fb0 <__NSArrayI 0x208c7fb0>(
1,
0
)

This shows, the first operation is paused, not the second one.

In my case there seem to be two syncing operations (maybe that's the problem?) and the wrong one gets unpaused.

ARC?

Does TICoreDataSync support ARC or is it still using the old manual reference counting?

TICDSSynchronizationOperation optimization suggestions

Hi!

I made few optimizations in [TICDSSynchronizationOperation syncChangesAfterCheckingForConflicts:inManagedObjectContext:] and [TICDSSynchronizationOperation backgroundApplicationContextObjectForEntityName: syncIdentifier:] methods and the synchronization become faster few times. I want to share my ideas with you.

So firstly I changed the way how changes are grouping by objectSyncID. In current version changes are grouping by filtering changes array with predicate. It is slowly, because there are a lot of NSString comparisons when we are searching changes with concrete objectSyncID. So I changed it with for loop and NSMapTable where the
keys are objectSyncID and values are arrays of TICDSSyncChange objects.
The code below shows the changes i done.

- (NSArray *)syncChangesAfterCheckingForConflicts:(NSArray *)syncChanges inManagedObjectContext:(NSManagedObjectContext *)managedObjectContext
{
    NSArray *identifiersOfAffectedObjects = [syncChanges valueForKeyPath:@"@distinctUnionOfObjects.objectSyncID"];
        TICDSLog(TICDSLogVerbosityEveryStep, @"Affected Object identifiers: %@", [identifiersOfAffectedObjects componentsJoinedByString:@", "]);

    if (self.localSyncChangesToMergeContext == nil) {
        return syncChanges;
    }

    NSMutableArray *syncChangesToReturn = [NSMutableArray arrayWithCapacity:[syncChanges count]];
    NSMapTable *changedObjectTable = [NSMapTable strongToStrongObjectsMapTable];
    NSString *objSyncIDKey=@"objectSyncID";

    //Groups syncCahnges by objectSyncID
    for (id obj in syncChanges)
    {
        NSString *ticsSyncID = [obj valueForKey:objSyncIDKey];
        NSMutableArray *objectChangesArray = [changedObjectTable objectForKey:ticsSyncID];
        if (!objectChangesArray)
        {
            objectChangesArray = [NSMutableArray arrayWithObject:obj];
            [changedObjectTable setObject:objectChangesArray forKey:ticsSyncID];
        }
        else
        {
            [objectChangesArray addObject:obj];
        }
    }

    //Constructs results array
    NSArray *syncChangesForEachObject = nil;
    for (NSString *eachIdentifier in identifiersOfAffectedObjects)
    {
        syncChangesForEachObject = [changedObjectTable objectForKey:eachIdentifier];
        syncChangesForEachObject = [self remoteSyncChangesForObjectWithIdentifier:eachIdentifier afterCheckingForConflictsInRemoteSyncChanges:syncChangesForEachObject inManagedObjectContext:managedObjectContext];
        [syncChangesToReturn addObjectsFromArray:syncChangesForEachObject];
        [changedObjectTable removeObjectForKey:eachIdentifier];
    }

    [changedObjectTable removeAllObjects];
    changedObjectTable=nil;
    return syncChangesToReturn;
}

The second thing I done is implementing reusability of fetched objects id in [TICDSSynchronizationOperation backgroundApplicationContextObjectForEntityName: syncIdentifier:] method. It gives a great results then we are applying more than one change to the same object in the same TICDSSynchronizationOperation. So I created NSMapTable property in TICDSSynchronizationOperation to cache fetched objects objectID and objectSyncID pairs. If objectSyncID and objectID pair is cached, TICDSSynchronizationOperation takes object directly form managedObjectContext, else executes fetch request to find it and saves results to cache.

- (NSManagedObject *)backgroundApplicationContextObjectForEntityName:(NSString *)entityName syncIdentifier:(NSString *)aSyncIdentifier
{
    id objectID = nil;
    objectID = [self.changedObjectsMapTable objectForKey:aSyncIdentifier];
    NSManagedObject *object = nil;
    // Searches object in cache
    if (objectID && (object = [self.backgroundApplicationContext objectRegisteredForID:objectID]))
    {
        if (object == nil)
        {
            TICDSLog(TICDSLogVerbosityErrorsOnly, @"Error fetching affected object with SyncID: %@", aSyncIdentifier);
        }
    }
    else 
    { // Makes fetch request if there is no cached object with aSyncIdentifier
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        [fetchRequest setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:self.backgroundApplicationContext]];

        NSError *anyError = nil;
        NSArray *results = nil;
        if (aSyncIdentifier) {
            [fetchRequest setPredicate:[[self predicateTemplate]predicateWithSubstitutionVariables:@{ @"syncID" : aSyncIdentifier}]];        
            results = [self.backgroundApplicationContext executeFetchRequest:fetchRequest error:&anyError];
        } else {
            results = nil;
        }

        if (results == nil) {
            TICDSLog(TICDSLogVerbosityErrorsOnly, @"Error fetching affected object: %@", anyError);
        }
        else
        {
            object = [results lastObject];
            [self.changedObjectsMapTable setObject:[object objectID] forKey:aSyncIdentifier];
        }
    }
    return object;
}

Application Sync Manager: Add a way to remove all sync data locally

The TICDSApplicationSyncManager class has a - removeAllSyncDataFromRemote to clear out the sync data remotely. Consider adding a - removeAllSyncDataFromLocal method to clear out any local sync-related files.

Is there a method in the TICoreDataSync framework to force the app to delete all of the local helper files? I've been looking for it but haven't been able to locate it.

AppliedSyncChangeSets.ticdsync does not save properly

I am encountering a problem where TICoreDataSync is not saving the local AppliedSyncChangeSets.ticdsync file properly. This makes it so that every time the app is loaded, it re-applies all TICoreDataSync change sets, rather than only the ones which have not yet been applied.

To one relationship with none synchronized entities bug ?

Hi,

To start, thanks for your awesome work, and to share it.

I'm testing your library with several scenarios, including relationships between synchronized and not synchronized object.

For example, I have 2 entities, A and B (How original ;)), and A inherits from TICDSSynchronizedManagedObject, while B not.

So, as far as I understand, only A will by synchronized. Next, I've added a to one relationship between A and B. The problem is that there is an exception thrown when saving modifications with this configuration.

The problem is that your library is looking for a ticdsSyncID attribute in my entity B.

The exception is only thrown for toOne relationships. So, I've managed to dig into your code to method createToOneRelationshipSyncChange: from TICDSSynchronizedManagedObject class.

My guess is that this method always create an TICDSSyncChange, even if destination entity isn't synchronized, that could cause the problem.

Here is my fix :

  • (void)createToOneRelationshipSyncChange:(NSRelationshipDescription *)aRelationship
    {
    NSManagedObject *relatedObject = [self valueForKey:[aRelationship name]];

    // Check that the related object should be synchronized
    if(![relatedObject isKindOfClass:[TICDSSynchronizedManagedObject class]])
    return;

    TICDSSyncChange *syncChange = [self createSyncChangeForChangeType:TICDSSyncChangeTypeToOneRelationshipChanged];

    TICDSLog(TICDSLogVerbosityManagedObjectOutput, @"[%@] %@", syncChange.objectSyncID, [self class]);

    [syncChange setRelatedObjectEntityName:[[aRelationship destinationEntity] name]];
    [syncChange setRelevantKey:[aRelationship name]];
    [syncChange setChangedRelationships:[relatedObject valueForKey:TICDSSyncIDAttributeName]];
    }

So, is my guess correct, or am I missing something ?

Thanks for your help.

Regards,

TICoreDataSync Missing Files on Github

From the No Thirst Support Forums:

I wanted to let you know that I was trying to use your https://github.com/nothirst/TICoreDataSync project on github and pulling down a clean version fails to build because it's missing the "00 Precompliled Headers" folder entirely in github. Here is the error:

clang: error: no such file or directory: '/Users/sean/Projects/Look At/TICoreDataSync/TICoreDataSync/00 Precompiled Headers/TICoreDataSync-iOS-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Thanks,

Sean

Incompatible with Cocoapods 0.19.1

Hi I receive this message when trying to include into my project Podfile:

[!] The post install hook of TICoreDataSync (1.0.2) is not compatible with this version of CocoaPods.

Does anyone have a workaround?

Items created before DBSessionDelegate set up not syncing

To sync my core data with Dropbox, I set it up as usual and then in the delegate method documentSyncManagerDidFinishedRegistering, I call [self documentSyncManager] initiateSynchronization. On the documentSyncManagerDidFinishSynchronization method I find out if it's the first time synchronizing, and if it is I call [self documentSyncManager] initiateDownloadOfWholeStore.

The problem is that if later on the service is switched off, and then a new item is added to the database, it isn't synchronized between devices. How can I get objects created when the service is not running to sync?

Can i sync without uploading?

The first device to sync has to upload first, but the uploaded store is never used, because downloading it would write over all device data. This renders the upload pointless, since it's just syncing based off syncing data.

Can i skip the upload process?

Download Whole Store Error

Hi guys,

I am having trouble downloading an entire store from Dropbox. I experience the same problem with the iOSNotebook sample app as well (the one that's pre-prepared).

In the file TICDSDropboxSDKBasedWholeStoreDownloadOperation.m, method - (void)restClient:(DBRestClient_)client loadedFile:(NSString_)destPath, line 305:

  success = [[self fileManager] fileExistsAtPath:unzippedFilePath];

Success is always no. I am trying to debug the issue. But I assume there must be something wrong with my setup.

Thanks!
Mazen

Having issues implementing TICoreData

Hi guys,
I just recently decided to give up on iCloud as it was a nightmare to implement it smoothly.

Dropbox sync had been my back up and i'm trying to follow the instructions on tims site, which are kind of out dated.

I'm actually trying to replicate by following the code in the examples folder, with the iOSnotebook project.

The first issue i ran into was that the dropboxSDK in the project was outdated, so had to download the latest one from dropbox for me to test it on the phone.

I'm at the application did finish launching stage and I'm getting this error for a method thats no longer in the SDK;

    [[DBSession sharedSession] link];

-link doesn't exist in the DBSession.h file.

so the question is have you guys run into this issue, if so what have you done to resolve it.

let me know. Thanks :)
abhi.

Dropbox Problem

The current DropboxSDK makes changes to the authorization process necessary.

Getting 'path not found' error

Through following the instructions in the guide here, or adding my own key and secret to the finished example provided with TICoreDataSync, I get a list of path not found errors like so:

[WARNING] DropboxSDK: error making request to /1/metadata/dropbox/com.timisted.notebook - Path '/com.timisted.notebook' not found

[WARNING] DropboxSDK: error making request to /1/metadata/dropbox/com.timisted.notebook/Documents/Notebook - Path '/com.timisted.notebook/Documents/Notebook' not found

Could somebody else try it with the most recent version and let me know how it works for them?

Recommendations on how to implement a pause/resume feature?

Thanks for all your work on TICoreDataSync; it's a great project.

I'm aiming to use TICDS in an app with a CoreData model that includes an external record file for some large NSData blobs. I want to prevent these objects from being synced unless a wifi connection is available. As far as I can tell, it's not currently possible to explicitly pause and resume synchronizations. I was consider hacking things to just block in various delegate callbacks if Reachability status isn't Wifi, but that's just evil.

Do you have any recommendations on how to implement pause/resume support?

Alternatively, is it possible to exclude some objects (or attributes) as part of a synchronization? I.e. could I exclude NSData attributes (marking them as a pseudo-fault) that TICDS recognizes their containing objects as being partially synchronized (such that large NSData blobs are only synchronized once wifi access becomes available)?

Whole Store Uploading: Be smarter about handling large store files

[update, 2013-01-29] As per the conversation below, uploading large whole store files can be problematic because the user shouldn't be allowed to update the store while the upload is happening. Perhaps we can copy the store off to a temp location before kicking off the upload.

[original message] After downloading whole data store, local device needs to apply all previous changes

When the user uploads the whole data store on device A (say, their iPhone), it uploads a copy of the core data store, and as they make changes it begins to upload change sets. However, when the user downloads the data store onto device B (say, their iPad), it has to first download the initial copy of the whole data store, and then successively apply all of the change sets. This is very time consuming, especially if there is a time lag between when device A first uploaded the data store, and when device B downloads it, because there can be many change sets.

iOS 6 sync issue

I get this error when attempting to manually initiate a sync:

error synchronizing: Error Domain=com.timisted.ticoredatasync Code=16 "Encryption error" 
UserInfo=0x1f0e39b0 {NSLocalizedDescription=Encryption error, 
kTICDSErrorClassAndMethod=-[TICDSDropboxSDKBasedSynchronizationOperation restClient:loadedFile:], 
NSUnderlyingError=0x1f06b970 
"The operation couldn’t be completed. (com.fuzzyaliens.fzacryptor error 10000.)"}

Getting iOSNotebook working on iOS6

I followed the “Guide to Example Apps” but couldn't get it running out of the box. I found I had to make a number of changes:

  1. Dropbox wouldn't let me create an app called “iOSNotebook” as it was already taken (no surprises there :)). So I changed the name of the Xcode project and target to iOSNotebookCA along with the TICDSDropboxSDKBasedApplicationSyncManager's globalAppIdentifier to @"com.timisted.iOSNotebookCA"
  2. Next I had to change Build Settings > Build Active Architectures Only = Yes
  3. I changed the deployment target to 5.1 so I could avoid having all test devices running 6.0
  4. I also had to change the info.plist file's URL string to reflect the Dropbox key assigned to my iOSNotebookCA (db-blahblahblah).
  5. And changed the DBSession root to kDBRootAppFolder

I'm not sure if I have taken the right approach but I managed to get both devices communicating with drop box. I got a few Dropbox messages about files and folders missing but running in TICDSLogVerbosityEveryStep I assumed these were not actually issues.

So now I'm at the stage where I get the following messages "Delegate denied synchronization after saving"

Blah -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : MOC saved, so beginning post-save processing
Blah -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Sync Manager will save Sync Changes context
Blah -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Sync Manager saved Sync Changes context successfully
Blah -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Asking delegate if we should sync after saving
Blah -[TICDSDocumentSyncManager synchronizedMOCDidSave:] : Delegate denied synchronization after saving

Does anyone know what I still need to do to get it right?

Regards

Rob

NB: while writing this a message that was created about 2 hours earlier has synced. Do I have a problem or can the sync just be very slow at times.

Syncing Through iCloud Ubiquity Container Directory

Have you looked into adding functionality that easily syncs using a directory in the iCloud ubiquity container? Clear (Mac/iOS) does this and it works well. This would obviously serve as an alternative to the Apple iCloud core data syncing functionality but still use iCloud. Also would have no need to set up a dropbox account. Thoughts?

Ordered relationships?

Does TICDS support ordered relationships in core data (available since iOS 5 and OS X 10.7)? If not do you have plans to add support?

Update to the latest Dropbox framework

I use the sample app iOSNotebook and just change the bundle id, app key and secret. It works fine.

But when I change the DropboxSDK to 1.3.2, it just works fine only first time debug from Xcode. If I stop the debug process and than launch the app from device directly, it won't sync anything. There is a network indicator always displays in status bar never disappear, seems something stuck. Change back to original DropboxSDK in iOSNotebook seems work fine again.

My device is iPhone4(iOS 6.0), iPad2 3G(iOS 5.1.1)

Apple had rejected the apps using Dropbox before, reason http://www.techdirt.com/articles/20120501/17545618733/apple-rejecting-apps-that-use-dropbox-because-gasp-users-might-sign-up-dropbox-accounts.shtml

Do I have to using original DropboxSDK version in iOSNotebook to get it work?

Unable to install DocSet in Xcode

I couldn't install the DocSet in Xcode. It throws the following error when trying to install:

Failed to download documentation package for TICoreDataSync Documentation.

Documentation package downloads must have http(s) URLs, but instead found: feed://timisted.github.com/TICoreDataSync/reference/publish/com.timisted.TICoreDataSync-0.7.3.xar.

Figure out how to handle Core Data model migration

Currently TICDS does not handle changes to the data model properly. If the model changes significantly enough sync failures will occur until all clients are using the same version of the data model.

Question: How does the TICoreDataSync framework deal with changes to an app's core data store model? If the model changes, how does it handle the changes?

Syncing same wholestore across multiple devices

I'm assuming that this is the expected result - but it's not working for me. What I noticed was a separate wholestore being created in a unique GUID folder for each device that is set up with syncing. Meaning, that the core data doesn't sync across different devices. I'm assuming I'm missing something or there is a flag somewhere set that makes this happen?

Just looking for some direction or where to look. I'm sure it's not a bug, just a stupid typo on my part.

Also, after the initial setup and download of the database, subsequent changes don't update on dropbox (even though I get notifications on the computer that files have changed).

Maybe it all has something to do with the recentsync issue posted below.

iOS Notebook doesn't import changes from Mac client

Apparently there is a problem with the Dropbox SDK on iOS. Syncing on the Mac works great, but syncing on iOS doesn't (uploading changes seem to work, but downloading/importing not).

Getting a lot of those errors while hitting refresh on my iPod (after adding new notes in the Mac client):

"2012-06-24 04:21:47.283 iOSNotebook[26185:707] [WARNING] DropboxSDK: error making request to /1/revisions/dropbox/com.timisted.notebook/Documents/Notebook/SyncChanges/D399E920-050B-46D0-A8E7-6893EBB0BEF7-26142-00001D52798268C6/0362197305,083796-73721D44-DB58-4C7F-B6E0-2A24B8164FFA-26185-00001D573298C525.syncchg - Path 'com.timisted.notebook/Documents/Notebook/SyncChanges/D399E920-050B-46D0-A8E7-6893EBB0BEF7-26142-00001D52798268C6/0362197305,083796-73721D44-DB58-4C7F-B6E0-2A24B8164FFA-26185-00001D573298C525.syncchg' not found"


This might be an issue with an updated Dropbox SDK and different paths?!

Any way to turn on/off synchronization?

I've been looking for a way to turn on/off sync but could not find any documented/supported method to do so. What would be a good way? I ask because sync would be an option, that the user can turn on/off whenever he wants, rather than enforced. Thank you!

Can I parse the wholestore (and sync changes) to generate my own ORM?

I'm interested in writing a service that can extract and display the contents of the store for a web-based (readonly) service. I.e. assume that a webserver has access to the Dropbox-based files, is it possible to parse the contents of the store and construct an ORM of the objects and data? Hypothetical example: I have an app that saves documents (that include text and images); what do I need to do to write a web server that can display these documents online?

One alternative is to use TICDS server-side (with some modifications to compile under UNIX, if possible) to massage things into an object model (or even JSON representation) and then build something on top of that. However, I'd like to cut out the middleman, so to speak, and write an adapter (in Ruby or Go, most likely) that can watch for directory/file changes and parse things itself.

There's some documentation here: https://github.com/nothirst/TICoreDataSync/wiki/Remote-File-Hierarchy Unfortunately, it's rather light on details of .syncchg files and whatnot.

Am I suicidal? Do you have any recommendations or tips on how to proceed? I've been digging through the source code, but any suggestions or advice you have would be greatly appreciated.

TICoreDataSync behavior and functionality related questions

These are not issues, but rather questions. I wasn't sure where to post these. I'd appreciate if you can find sometime to address these. Thanking in anticipation.

  • Does iCloud deprecates TICoreDataSync? (I'm asking because ZSync was deprecated by Marcus Zarra after the introduction of iCloud by Apple. Reference: https://github.com/mzarra/ZSync) What's your thoughts on iCloud, and what are the advantages and disadvantages of using TICoreDataSync instead of iCloud?
  • Does TICoreDataSync support "Core Data Model Versioning and Data Migration"?
  • Does TICoreDataSync support manual conflict resolution? Yes. Use TICDSDocumentSyncManagerDelegate.
  • Does TICoreDataSync support deleting the files on remote server and starting from scratch?
  • Does TICoreDataSync support notifications, for the case when data on the remote server changes?
  • Does TICoreDataSync support "ordered" relationship (NSOrderedSet)? For reference, see Core Data Release Notes for OS X v10.7 and iOS 5.0 here: http://developer.apple.com/library/mac/#releasenotes/DataManagement/RN-CoreData/_index.html.
  • Does TICoreDataSync support advanced "Store in External Record File" for Core-Data entity attribute (setAllowsExternalBinaryDataStorage:)? For reference, see Core Data Release Notes for OS X v10.7 and iOS 5.0 here: http://developer.apple.com/library/mac/#releasenotes/DataManagement/RN-CoreData/_index.html.
  • How does TICoreDataSync respond if the application is removed from Device A, and then it's reinstalled? Does it automatically pull all the data from the Dropbox, and uses the same UUID for the device? Or will it create a new UUID for the device?
  • Are there any known issues? Other than the ones that are in the "Issues" section of the Github page.
  • Are you aware of any production iOS applications that are using TICoreDataSync? Knowing that applications similar to the one that I'm planning are using TICoreDataSync will give me some confidence.

Thanks.

Best practices in regards of whole store download on new devices

Please excuse this not being an issue, but more of a question.

When adding a new device after having synced a larger amount of data, I see downloading the whole store taking some time to finish. Afterwards the existing store gets thrown away and replaced with the new store.

What are your best practices regarding this process? Do you block the user interface while the download is running? Or do you merge the local changes into the downloaded store?

Thanks for this awesome framework, by the way. I love that I am able to look into the code and debug the sync process myself. Other than using a black box like iCloud syncing.

[iCloud] How to pause/resume the auto-sync mechanism and keep generating sync change files?

I am using the iCloud branch of TICDS in my project. I found that the TICDSFileManagerBasedDocumentSyncManager has 2 methods [beginPollingRemoteStorageForChanges] and [stopPollingRemoteStorageForChanges], while the TICDSiCloudBasedDocumentSyncManager has only [enableAutomaticSynchronizationAfterChangesDetectedFromOtherClients]. I'm trying to provide a wifi-only sync feature, as the syncing mechanism will automaticlly paused when the network is switching to WWAN or completely shutdown (airplane mode, etc), but I want to preserve the app sync manager and doc sync manager configured to keep generating sync change files for future syncing. So the questions are:

  1. how can i stop the watching(polling) function on TICDSiCloudBasedDocumentSyncManager after calling [enableAutomaticSynchronizationAfterChangesDetectedFromOtherClients]?
  2. the [deregisterDocumentSyncManager] of TICDSDocumentSyncManager will set the documentIdentifier and many other properties to nil, so I should not call [registerConfiguredDocumentSyncManager] to re-register, right? Shall I configure the document sync manager again?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.