Permalink
Browse files

fix potential error where sync may overwrite local note with remote c…

…hanges if note was too large
  • Loading branch information...
fredrocious committed Mar 23, 2013
1 parent 0c9e3bf commit 1babb709682fbf783527310ef45d4fada5fb3abc
Showing with 4 additions and 1 deletion.
  1. +4 −1 SimplenoteEntryCollector.m
@@ -403,8 +403,11 @@ - (NSDictionary*)preparedDictionaryWithFetcher:(SyncResponseFetcher*)fetcher rec
[syncMD setObject:[NSNumber numberWithInt:version] forKey:@"version"];
[syncMD setObject:[NSNumber numberWithBool:NO] forKey:@"dirty"];
} else {
- if ([fetcher statusCode] == 412 || [fetcher statusCode] == 413) {
+ if ([fetcher statusCode] == 412) {
[syncMD setObject:[NSNumber numberWithBool:NO] forKey:@"dirty"];
+ } else if ([fetcher statusCode] == 413) {
+ // note was too large, don't clear dirty flag
+ [syncMD setObject:[NSNumber numberWithBool:YES] forKey:@"error"];
}
[syncMD setObject:[NSNumber numberWithInt:version] forKey:@"version"];
}

0 comments on commit 1babb70

Please sign in to comment.