Re: When do CBLModel values get updated from the CBLDocument after a sync?

2016-09-15 Thread Brendan Duddridge
I've filed this as an issue in GitHub because I think it's a bug of some 
sort:

https://github.com/couchbase/couchbase-lite-ios/issues/1442

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/0f080053-54ad-4655-9116-88c0e72292fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When do CBLModel values get updated from the CBLDocument after a sync?

2016-09-15 Thread Brendan Duddridge
After doing more tests, it does seem that the problem is due to the 
dictionary of values not being updated from the CBLModel's 
document:didChange: method.

 If I change a property that's directly on my model class, such as an 
"isFavourite" flag, it gets updated in the CBLDocument AND the CBLModel 
subclass after a sync.  Just not when I change a value inside my 
NSDictionary of values.

I suspect that could also happen with any collection class, such as an 
array property?

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/1c3a69f1-0dda-4962-b55f-95acc4dd030d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When do CBLModel values get updated from the CBLDocument after a sync?

2016-09-14 Thread Brendan Duddridge
Maybe because what's actually changing is a value within an NSDictionary 
property and not the entire values property itself?


On Wednesday, September 14, 2016 at 8:33:44 PM UTC-6, Jens Alfke wrote:
>
>
> On Sep 14, 2016, at 4:17 PM, Brendan Duddridge  > wrote:
>
> Do I need to force the CBLModel instances to update themselves after a 
> sync? Or do I need to refetch them from the database in order to get 
> updated data in my model objects?
>
>
> No, the model object should automatically update whenever the document 
> does. This is weird.
>
> The update of the CBLModel’s properties is triggered by a call from 
> -[CBLDocument revisionAdded:notify:]. I can’t think of how the 
> CBLDocument’s properties could change without this happening.
>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/4f3eae6d-d9c7-4bbd-98b8-3d969491c6b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When do CBLModel values get updated from the CBLDocument after a sync?

2016-09-14 Thread Jens Alfke

> On Sep 14, 2016, at 4:17 PM, Brendan Duddridge  wrote:
> 
> Do I need to force the CBLModel instances to update themselves after a sync? 
> Or do I need to refetch them from the database in order to get updated data 
> in my model objects?

No, the model object should automatically update whenever the document does. 
This is weird.

The update of the CBLModel’s properties is triggered by a call from 
-[CBLDocument revisionAdded:notify:]. I can’t think of how the CBLDocument’s 
properties could change without this happening.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/48FE3D8F-D724-4D72-82BB-7D6EBA4AEE82%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.