Possible Object/Autosave Bug
I think I've hit on a bug(or I'm being completely stupid and missing something) in the $meteorObject/autosave functionality. I've created a reproduction here: https://github.com/cantoine/autosave-reproduction
The basics of it are that as soon as a route is loaded if $scope.$meteorObject is used there will be an update triggered which can be seen from the collection hook before event being fired off on the client and the server.
If I switch to using $scope.$meteorCollection even with autosave turned on this does not happen and I'm not sure if this is expected behavior(if it is I'm very confused by it) or if the update should not be triggered upon load/state change.
I've added test data into the reproduction that gets inserted upon startup in attempt to show exactly what I'm doing when this is happening.
Hopefully this makes sense and the reproduction helps.
Thanks! Chris
It is definitely a bug. See https://github.com/Urigo/angular-meteor/issues/828
I updated my repo to use 1.0.6 and I'm still seeing the same behavior.
Thanks! Chris
I think those are different bugs. sorry for not responding, I saw this bug and hopefully will get to that soon.
@Urigo Not a problem, from my toying around it seems that the 'not using $set' error happens upon load but then after that it doesn't occur anymore so I think if the initial autosave issue is resolved it will take care of the other part, that is if I'm understanding the other issue correctly. If you need anything from me to help test or find the issue let me know.
Thanks! Chris
@cantoine if you could pull request a failing test for this scenario it will be the best thing ever
@Urigo I attempted a failing test for this but I have to admit I'm not completely confident it's the correct way to go about testing this scenario so I apologize ahead of time if I screwed it up.
Take a look and let me know if that works, if it doesn't then if you could give me some guidance I'd appreciate it.
Thanks! Chris
@cantoine can you please try this version: https://github.com/DAB0mB/angular-meteor/tree/v1.0.x and tell me if it works for you? Make sure you use branch v1.0.x
1.2.1 solves the issue, thanks for all the help @Urigo @DAB0mB