Closed corot closed 7 years ago
@corot Does it happen with the whatever object in the db? Even with the coke mesh?
yes. The problem seems to be in the way we grab the objects from the ViewIterator, because the objects are properly retrieved from the database and stored in the viewelements vector!
I wonder what is the ViewIterator underlying mechanism... maybe that could explain why it stopped working on 16.04 / kinetic!
Works fine now. Thanks!
This causes issue https://github.com/wg-perception/tabletop/issues/31, but ecto crash reports rather cryptically "[what] = value type is 0 not 2". When loading objects from couchdb, the query returns the proper number of objects, but without data: the view fields map is empty. Then, this line fails because key "_id" cannot be found and returns end(). Then call get_str() on an empty objects fails because the object ype is 0 (object, but I suppose 0 is the default value). Actually, I'm shock that calling .second on the returned pointer, that must necessarily be end() doesn't crash before!.
Going deeper, the problem seems to be in the view_iterator. No idea why, but if I bypass the view_iterator * and ++ operators by making viewelements public and iterating directly over the vector, then magically objects contain data and all works as before:
That said, no idea why this happens now on 16.04. Honestly, I don't understand the View and ViewIterator working, so much less why is not working.