Open kaisellgren opened 11 years ago
There's an attached sample project that fails, I'll also add the link here for easier access: https://docs.google.com/file/d/0B8bfJ10MXQKZSGlYeHN3UWhmQ2c/edit?usp=sharing
Repro:
1) Pub install 2) Install Mongodb, have it running at default ports 3) dart run.dart 4) dart build.dart 5) dart2js web/out/index.html_bootstrap.dart -o'web/out/index.html_bootstrap.dart.js' 6) Open the web/out/index.html in Dartium and Chrome.
In Dartium you see the "test" printed on the console, but not in Chrome/Fx.
So string representation of runtimeType of class is undefined at dart2js. It mean it is not suitable as a dbType (actially Collection name in MongoDB)
Save path is to override dbType method in each PersistentObject class in your domain model, for example
String dbType => 'Tag'
This fixed all our issues with these nulls. :)
However, everyone else will face the same problem since all you need is to use persistent list and dart2js...
We need to place that in the docs so people specify the collection name or we find a real solution that is independent from the user of this library (the optimal choice).
I'll leave this task open, you can decide if this is solved or not.
One solution is to remove default implementation in base class (change to Error 'Must be implemented') Then all clients unifirmely would have to implement dbType. It somewhat unnececcary on server side objectory though - so such clients would be unduly affected
I'll think about it
So, as per this issue: https://code.google.com/p/dart/issues/detail?id=10334
It seems we have to change how Objectory works.