Comments (7)
from ensembles.
Hi Drew,
thanks for responding so quickly!
I do indeed call the merge, equally to how it happens in the sample app. I will check back for the did-save-merged-changes and respond later today.
Thanks so far,
Timo
Edit: I Just checked, I have implemented it as follows:
- (void)persistentStoreEnsemble:(CDEPersistentStoreEnsemble *)ensemble didSaveMergeChangesWithNotification:(NSNotification *)notification
{
[managedObjectContext performBlock:^{
[self->managedObjectContext mergeChangesFromContextDidSaveNotification:notification];
}];
}
Where managedObjectContext
is my context which holds the data shown in the UI. I'll post more logs tonight.
from ensembles.
Some more information which might help:
I just checked on a separate Mac which has not installed the app in question, and the data seems to have been added successfully to iCloud:
baselines:
total 24
drwxr-xr-x 5 tj staff 160B Aug 24 09:12 .
drwxr-xr-x 6 tj staff 192B Aug 24 08:20 ..
-rw-r--r--@ 1 tj staff 229B Aug 24 09:08 .0_297B6C72-3521-40A5-98DA-288FB42C069C-49411-00000E551C322F25_99D11266.cdeevent.icloud
-rw-r--r--@ 1 tj staff 229B Aug 24 00:07 .0_5219CAEC-E5A5-4897-A40B-8AE3F921C953-47487-00000E2862813FFD_5A7CC120.cdeevent.icloud
-rw-r--r--@ 1 tj staff 229B Aug 24 00:12 .0_9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A_83E669A0.cdeevent.icloud
data:
total 0
drwxr-xr-x 2 tj staff 64B Aug 24 08:20 .
drwxr-xr-x 6 tj staff 192B Aug 24 08:20 ..
events:
total 16
drwxr-xr-x 4 tj staff 128B Aug 24 09:12 .
drwxr-xr-x 6 tj staff 192B Aug 24 08:20 ..
-rw-r--r--@ 1 tj staff 222B Aug 24 09:08 .1_99D11266-43D6-4FC0-8C53-5C76364060CC-49411-00000E551C074D9B_1.cdeevent.icloud
-rw-r--r--@ 1 tj staff 222B Aug 24 09:08 .2_99D11266-43D6-4FC0-8C53-5C76364060CC-49411-00000E551C074D9B_2.cdeevent.icloud
stores:
total 16
drwxr-xr-x 4 tj staff 128B Aug 24 08:20 .
drwxr-xr-x 6 tj staff 192B Aug 24 08:20 ..
-rw-r--r-- 1 tj staff 351B Aug 24 00:10 83E669A0-BABB-40EC-A781-F3EF629F7C91-50878-00000E805ACFC788
-rw-r--r-- 1 tj staff 351B Aug 24 00:07 99D11266-43D6-4FC0-8C53-5C76364060CC-49411-00000E551C074D9B
So there does not seem to be a problem with actually synchronizing the data, which is good I guess.
from ensembles.
from ensembles.
I have digged a little into the Ensemble implementation, and have found that the delegation method from your previous comment is never called.
In CDEEventIntegrator.m, in line 167 where it checks for changes, hasChanges is always false so it never gets to actually merge anything.
Logs from Mac 1:
2018-08-24 18:31:26.964550+0200 [61108:1865423] -[CDEICloudFileSystem repairEnsembleDirectory:completion:] line 176: Checking if repairs are needed in iCloud Drive
2018-08-24 18:31:26.967221+0200 [61108:1865423] -[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:] line 724: Retrieving registration info
2018-08-24 18:31:26.982400+0200 [61108:1865423] -[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:]_block_invoke_2 line 743: Downloading file at remote path: /Dropshare5UploadHist/stores/83E669A0-BABB-40EC-A781-F3EF629F7C91-50878-00000E805ACFC788
2018-08-24 18:31:26.992804+0200 [61108:1865423] -[CDECloudManager createRemoteDirectories:withCompletion:] line 688: Creating remote directories
2018-08-24 18:31:27.014798+0200 [61108:1865423] -[CDECloudManager importNewDataFilesWithCompletion:] line 159: Transferring new data files from cloud to event store
2018-08-24 18:31:27.015349+0200 [61108:1865423] -[CDECloudManager importNewBaselineEventsWithCompletion:] line 143: Transferring new baselines from cloud to event store
2018-08-24 18:31:27.016602+0200 [61108:1865423] -[CDEBaselineConsolidator consolidateBaselineWithCompletion:] line 65: Consolidating baselines
2018-08-24 18:31:27.016945+0200 [61108:1903104] -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 76: Found baselines with unique ids: (
"9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A"
)
2018-08-24 18:31:27.018075+0200 [61108:1903104] -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 108: Baselines remaining that need merging: (
"9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A"
)
2018-08-24 18:31:27.018180+0200 [61108:1865423] -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke_2 line 131: Finishing baseline consolidation
2018-08-24 18:31:27.018264+0200 [61108:1865423] -[CDECloudManager importNewRemoteNonBaselineEventsWithCompletion:] line 127: Transferring new events from cloud to event store
2018-08-24 18:31:27.022295+0200 [61108:1903104] -[CDEEventIntegrator integrate:] line 313: Integrating new events into main context
2018-08-24 18:31:27.023388+0200 [61108:1903104] -[CDEEventIntegrator integrate:]_block_invoke line 333: Baseline has changed. Will carry out full integration of the persistent store.
2018-08-24 18:31:27.027697+0200 [61108:1865423] -[CDECloudManager exportDataFilesWithCompletion:] line 344: Transferring data files from event store to cloud
2018-08-24 18:31:27.028315+0200 [61108:1865423] -[CDECloudManager exportNewLocalBaselineWithCompletion:] line 332: Transferring baseline from event store to cloud
2018-08-24 18:31:27.029644+0200 [61108:1903102] -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
2018-08-24 18:31:27.033065+0200 [61108:1865423] -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/baselines/0_9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A_83E669A0.cdeevent
2018-08-24 18:31:27.085152+0200 [61108:1865423] -[CDECloudManager exportNewLocalNonBaselineEventsWithCompletion:] line 320: Transferring events from event store to cloud
2018-08-24 18:31:27.087219+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 584: Removing outdated files
2018-08-24 18:31:27.087795+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 603: Baseline files in cloud: {(
)}
2018-08-24 18:31:27.087876+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 604: Aliases for baseline files in store: {(
"0_9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A.cdeevent",
"0_9B9EC2F5-721E-4CF0-95B2-1C896FA7E904-50878-00000E805C45382A_83E669A0.cdeevent"
)}
2018-08-24 18:31:27.087907+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 605: Baseline files to remove: {(
)}
2018-08-24 18:31:27.088098+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 612: Event files in cloud: {(
)}
2018-08-24 18:31:27.088136+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 613: Aliases for event files in store: {(
)}
2018-08-24 18:31:27.090815+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 614: Event files to remove: {(
)}
2018-08-24 18:31:27.091069+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 620: Data files in cloud: {(
)}
2018-08-24 18:31:27.091107+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 621: Data files in store: {(
)}
2018-08-24 18:31:27.091135+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 622: Data files to remove: {(
)}
2018-08-24 18:31:27.091162+0200 [61108:1865423] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 635: Removing cloud files:
2018-08-24 18:31:27:091 [61108:1865423] Merging with completion
Logs from Mac 2:
18:30:36.361874 +0200 -[CDEICloudFileSystem repairEnsembleDirectory:completion:] line 176: Checking if repairs are needed in iCloud Drive
18:30:36.362999 +0200 -[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:] line 724: Retrieving registration info
18:30:36.398950 +0200 -[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:]_block_invoke_2 line 743: Downloading file at remote path: /Dropshare5UploadHist/stores/1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719
18:30:36.405677 +0200 -[CDECloudManager createRemoteDirectories:withCompletion:] line 688: Creating remote directories
18:30:36.426708 +0200 -[CDECloudManager importNewDataFilesWithCompletion:] line 159: Transferring new data files from cloud to event store
18:30:36.427307 +0200 -[CDECloudManager importNewBaselineEventsWithCompletion:] line 143: Transferring new baselines from cloud to event store
18:30:36.428218 +0200 -[CDEBaselineConsolidator consolidateBaselineWithCompletion:] line 65: Consolidating baselines
18:30:36.428675 +0200 -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 76: Found baselines with unique ids: (
"585888B6-00C0-4E3E-A54F-110EFA5F1015-55410-0000921F015FF1A6"
)
18:30:36.429938 +0200 -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 108: Baselines remaining that need merging: (
"585888B6-00C0-4E3E-A54F-110EFA5F1015-55410-0000921F015FF1A6"
)
18:30:36.430033 +0200 -[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke_2 line 131: Finishing baseline consolidation
18:30:36.430117 +0200 -[CDECloudManager importNewRemoteNonBaselineEventsWithCompletion:] line 127: Transferring new events from cloud to event store
18:30:36.467005 +0200 -[CDEEventIntegrator integrate:] line 313: Integrating new events into main context
18:30:36.472713 +0200 -[CDECloudManager exportDataFilesWithCompletion:] line 344: Transferring data files from event store to cloud
18:30:36.473114 +0200 -[CDECloudManager exportNewLocalBaselineWithCompletion:] line 332: Transferring baseline from event store to cloud
18:30:36.474193 +0200 -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
18:30:37.994914 +0200 -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/baselines/0_585888B6-00C0-4E3E-A54F-110EFA5F1015-55410-0000921F015FF1A6_1B498FBF.cdeevent
18:30:38.043172 +0200 -[CDECloudManager exportNewLocalNonBaselineEventsWithCompletion:] line 320: Transferring events from event store to cloud
18:30:38.046011 +0200 -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
18:30:38.053162 +0200 -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
18:30:38.058003 +0200 -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
18:30:38.064588 +0200 -[CDEEventMigrator migrateStoreModificationEvents:toFile:completion:] line 100: Migrating event store events to file
18:30:38.069950 +0200 -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/events/1_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_1.cdeevent
18:30:38.121865 +0200 -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/events/2_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_2.cdeevent
18:30:38.173366 +0200 -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/events/3_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_3.cdeevent
18:30:38.239890 +0200 -[CDECloudManager transferFilesInTransitCacheToRemoteDirectory:completion:]_block_invoke_2 line 446: Uploading file to remote path: /Dropshare5UploadHist/events/4_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_4.cdeevent
18:30:38.302111 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 584: Removing outdated files
18:30:38.303398 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 603: Baseline files in cloud: {(
)}
18:30:38.303516 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 604: Aliases for baseline files in store: {(
"0_585888B6-00C0-4E3E-A54F-110EFA5F1015-55410-0000921F015FF1A6_1B498FBF.cdeevent",
"0_585888B6-00C0-4E3E-A54F-110EFA5F1015-55410-0000921F015FF1A6.cdeevent"
)}
18:30:38.303586 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 605: Baseline files to remove: {(
)}
18:30:38.304543 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 612: Event files in cloud: {(
)}
18:30:38.304660 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 613: Aliases for event files in store: {(
"1_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_1.cdeevent",
"3_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_3.cdeevent",
"4_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_4.cdeevent",
"2_1B498FBF-B3D3-419A-BFCD-F6A44B800EA2-55410-0000921F0121F719_2.cdeevent"
)}
18:30:38.304732 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 614: Event files to remove: {(
)}
18:30:38.305161 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 620: Data files in cloud: {(
)}
18:30:38.305240 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 621: Data files in store: {(
)}
18:30:38.305316 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 622: Data files to remove: {(
)}
18:30:38.305380 +0200 -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 635: Removing cloud files:
from ensembles.
For what it's worth, I just tested with the Idiomatic Mac (untouched from this repository) app and also there data does not sync between the two macs.
from ensembles.
Alright. I don't know how I did it, but now it works for both Idiomatic as well as my existing Mac App. :) I'll continue development and monitor how well it works. Thanks very much until here!
from ensembles.
Related Issues (20)
- Error merging: Error Domain=CDEErrorDomain Code=201 "(null)" HOT 6
- Ensembles slowing down device dramatically HOT 19
- didSaveMergeChangesWith callback never called HOT 6
- Strange merging error HOT 7
- iOS 12 users can no longer sync HOT 4
- Push 1.7.2 and 1.8 to Cocoapods Trunk HOT 7
- Removing from set doesn't remove from other devices, causes re-add HOT 2
- Command PhaseScriptExecution failed with a nonzero exit code HOT 2
- Idiomatic iOS Demo - Unable to resolve build file: XCBCore.BuildFile
- ensembles - Error in merge: Error Domain=CDEErrorDomain Code=201 “(null)” HOT 5
- CloudKit Working? Does Anyone have actually have Subscription, etc. working? HOT 3
- Crash in persistentStoreEnsemble: globalIdentifiersForManagedObjects: - uniqueIdentifier - entity is not KeyValueCoding compliant HOT 14
- FR: Ensembles to sync Realm database across devices
- CoreData + Ensembles migration issue HOT 3
- iOS 14 warning CDEObjectChange.propertyChangeValues is using a nil or insecure value HOT 2
- Build Warnings - iOS 12 and above HOT 8
- Apple silicon Macs support issue - The app links with libraries that are not present on Mac HOT 2
- [general] 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release HOT 14
- Dropbox Expired Access Token HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ensembles.