couchbaselabs / CouchCocoa

Objective-C API for CouchDB on iOS and Mac OS
http://couchbaselabs.github.com/CouchCocoa/docs/
218 stars 66 forks source link

Change to fix issue where KVO was sending changes when data had not changed. #44

Closed drekka closed 12 years ago

drekka commented 12 years ago

Only change b9d2ce5

This updates the replicator to only send out KVO notifications when the value has actually changed.

snej commented 12 years ago

The first four commits look unrelated to this request.

The fifth commit has the side effect that if both _completed and _total change (which is common) then it will send out one notification with only the .completed property changed, then a second with .total also changed. This means an observer of the first notification will see a non-matching pair of values (the new completed with the old total.)

What's the problem this is fixing?

drekka commented 12 years ago

Yep I have not been able to figure out how to pick out one commit and pull request against it. I'm sure it can be one, just could not find it.

The problem I was getting was that if one value changed, I was getting two change notifications. So if completed changed, I was getting told total had changed as well when it had not.

I see what you are talking about with the change I've suggested, I'll kill this request and rework the code to account for it.