angular-meteor icon indicating copy to clipboard operation
angular-meteor copied to clipboard

Possible Object/Autosave Bug

Open cantoine opened this issue 11 years ago • 8 comments

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

cantoine avatar Oct 29 '15 20:10 cantoine

It is definitely a bug. See https://github.com/Urigo/angular-meteor/issues/828

aaronroberson avatar Nov 07 '15 05:11 aaronroberson

I updated my repo to use 1.0.6 and I'm still seeing the same behavior.

Thanks! Chris

cantoine avatar Nov 07 '15 13:11 cantoine

I think those are different bugs. sorry for not responding, I saw this bug and hopefully will get to that soon.

Urigo avatar Nov 07 '15 13:11 Urigo

@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 avatar Nov 07 '15 13:11 cantoine

@cantoine if you could pull request a failing test for this scenario it will be the best thing ever

Urigo avatar Nov 07 '15 14:11 Urigo

@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 avatar Nov 09 '15 02:11 cantoine

@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

DAB0mB avatar Nov 10 '15 21:11 DAB0mB

1.2.1 solves the issue, thanks for all the help @Urigo @DAB0mB

cantoine avatar Nov 10 '15 23:11 cantoine