Comments (14)
For the record I've had a go at this... changing CDEPropertyChangeValue.h to
and CDEPropertyChangeValue.m by adding:
- (BOOL)supportsSecureCoding
{
return TRUE;
}
and updating initWithCoder.
self.propertyName = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"propertyName"];
self.type = [aDecoder decodeIntegerForKey:@"type"];
self.filename = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"filename"];
self.value = [aDecoder decodeObjectOfClass:[NSObject class] forKey:@"value"];
self.relatedIdentifier = [aDecoder decodeObjectOfClass:[NSObject class] forKey:@"relatedIdentifier"];
self.addedIdentifiers = [aDecoder decodeObjectOfClass:[NSSet class] forKey:@"addedIdentifiers"];
self.removedIdentifiers = [aDecoder decodeObjectOfClass:[NSSet class] forKey:@"removedIdentifiers"];
self.movedIdentifiersByIndex = [aDecoder decodeObjectOfClass:[NSDictionary class] forKey:@"movedIdentifiersByIndex"];
Though based on the runtime errors I'm now getting... it's not right.
I suspect that [NSObject class] isn't good enough and I do not know what to do with these.
from ensembles.
The latest version of Ensembles should already have a custom transformer (CDEPropertyChangeValueTransformer) for CDEPropertyChangeValue, to stop this error. Are you on the latest Ensembles?
Note that the warnings can still appear for your own model transformables, but they should not appear for CDEPropertyChangeValue. I'm afraid you can't really just change the transformer in your model either, because you are dealing with old data that was serialized using the old transformer. You need to put in place something like CDEPropertyChangeValueTransformer for your own code, or migrate the property to one using a secure transformer.
from ensembles.
from ensembles.
Ah, wait. Sorry, I got confused. This has been fixed in Ensembles 2, but I didn't get a chance to backport the fix to Ensembles 1 yet. If anyone has access to both and wants to try cherrypicking a PR, I will happily consider it.
from ensembles.
I'd be happy to have a go at this, though I'd need the matching .m and .h files from Ensembles 2.
from ensembles.
I've invited you to the Ensembles 2 repo.
See these hashes for the changes:
def40edc3a6d9b23c539501e8c1886fab193de1c
8ee18c8c7d4a3a45348d67aaa3a888a7961c0af1
641e307f996faae865ebf26d8f137229b77d3385
These introduce the CDEPropertyChangeValueTransformer class. You then need to insert that in the Core Data model of Ensembles. Let me know if there are any problems. Should be mostly copy and paste work.
from ensembles.
from ensembles.
No change to model version. The transformer is not part of the model hash if I recall properly (check the git change to be sure). The transformer in question is designed to also unarchive old data, so no special handling needed.
from ensembles.
from ensembles.
from ensembles.
Quick question, has anyone tested the impact of introducing the new transformer into an existing app that already has data? Say I have a version 1.0 of my app in production, with customers with data, and then I update my version of Ensembles in my app and push out a version 1.1 that uses the new transformer - will my customers' existing data still be okay, given that they used to be archived/unarchived without the secure transformer and now they're trying to be unarchived with a different transformer?
I'm asking because I vaguely recall running into this issue myself many months ago when working to fix the warning in my app (unrelated to Ensembles in this case), and existing data wasn't getting loaded correctly anymore. But I didn't have the time to look into it further to see if there was an easy fix (so the warning persists in my app for now). Just wanted to raise it here before any PR is merged, so that if this is an issue, unwitting Ensembles 1 users like myself won't update and find everything destroyed.
from ensembles.
from ensembles.
Seems reasonable, admittedly with me not being familiar with the code. So long as you did some sort of test where you ran the app using the old, insecure transformer first, then pod-installed or otherwise updated Ensembles to the new version using the secure transformer, and then re-ran the app and were able to see the original data without issue, then that's probably good enough.
from ensembles.
The new transformer actually just does what the old one did, ie the default one, so it should all work. We have been using this code in Ensembles 2 for about 6 months, and no problems with legacy.
from ensembles.
Related Issues (20)
- Error merging: Error Domain=CDEErrorDomain Code=201 "(null)" HOT 6
- No synchronization happening HOT 7
- 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
- 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.