Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix potential error where sync may overwrite local note with remote c…
…hanges if note was too large
  • Loading branch information
chengfred committed Mar 23, 2013
1 parent 0c9e3bf commit 1babb70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SimplenoteEntryCollector.m
Expand Up @@ -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"];
}
Expand Down

0 comments on commit 1babb70

Please sign in to comment.