-
-
Notifications
You must be signed in to change notification settings - Fork 878
Ability to revert all changes or a single field on PFObject
.
#52
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
Comments
I am also facing the same issue as in #51. Please provide us quick fix for this. |
so something like: - (void)revert {
@synchronized (lock) {
[operationSetQueue removeAllObjects];
[self rebuildEstimatedData];
}
}
-(void)revertObjectForKey:(NSString *)key {
@synchronized (lock) {
NSUInteger index = [operationSetQueue indexOfObject:key];
[operationSetQueue removeObjectAtIndex:index];
[self rebuildEstimatedData];
}
} I can give this issue a go if no one else is doing it... |
@kashif pretty close, there are a little bit more things there - |
thanks for the info @nlutsenko just about to send a pull request. At the moment I am thinking: - (void)revert {
@synchronized (lock) {
[operationSetQueue removeAllObjects];
[self rebuildEstimatedData];
[self checkpointAllMutableContainers];
}
}
-(void)revertObjectForKey:(NSString *)key {
@synchronized (lock) {
NSUInteger index = [operationSetQueue indexOfObject:key];
[operationSetQueue removeObjectAtIndex:index];
[_availableKeys removeObject:key];
PFFieldOperation *changes = [[self unsavedChanges] objectForKey:key];
index = [operationSetQueue indexOfObject:changes];
[operationSetQueue removeObjectAtIndex:index];
[self rebuildEstimatedData];
[self checkpointAllMutableContainers];
}
} |
thanks @grantland having a look |
Another optimization that Android should probably have is no-oping if we're not dirty or the key isn't dirty. |
Fully done. Thanks everyone. |
thanks @nlutsenko for your help! |
This is not fully fixed for me. But after killing the app and relaunching the app again and fetch the data from [PFUser currentUser] it doesn't shows up the revert data instead it shows the wrong data for which I opened the issue #51. @nlutsenko : can you please check this. |
The label |
After changing a single field on
PFObject
- there is no functionality to revert it back to the server state, even though we have the server state available internally. This is implemented in dotNet SDK viaParseObject.revert()
method which reverts any changes to an object that were done after last successful save/fetch.Implementation would require:
PFObject.revert()
that would clear all operations inoperationSetQueue
and rebuildestimatedData
PFObject.revertObjectForKey(key: String)
that would remove all operations for that key inoperationSetQueue
as well as rebuildestimatedData
.The text was updated successfully, but these errors were encountered: