Why is notifyAboutChangedObjects called when sync context did save?
When we receive a did-save notification, we call
notifyAboutChangedObjects(from notification:), which, in turn, callsprocessChangedLocalObjects(_:). That method will then distribute the objects to all change processors
Calling notify... happens on did-save notifications for both MOCs (view and sync).
I see why this is done for the view context; after merging the changed MOs into the sync context, we want to send them along to the change processors where presumably they will be uploaded to CloudKit by MoodUploader.
But, I do not understand why notify... is called when the sync MOC did-save. The remap calls should be mostly a no-op; there's an early return:
guard unmappedMO.managedObjectContext !== context else { return unmappedMO }
I believe the change processors are also a no-op since there's nothing more do download or upload. Am I correct about the no-op on the change processors? Is this by design? Why?
Aside: Could there be situations where saves are called back-to-back and an upload change processor didn't finalize the Mood upload by setting its remoteIdentifier property?
https://github.com/objcio/core-data/issues/26#issuecomment-308681220