1.3.6 Subscribe returns no items
Hi, I upgraded to 1.3.6 but my subscriptions no longer work. No errors in the console but no matter what i do they are blank. My shared code can be seen at https://ide.c9.io/eba_sfdc/booker Basically, i publish "Items" and try to subscribe to them with the below code (which works until 1.3.5 and I have "items" served):
angular.module('booker').controller('AdminCtrl', ['$scope',
'$rootScope','$translate', '$reactive',
function ($scope, $rootScope, $translate, $reactive) {
$reactive(this).attach($scope);
$scope.item = {
itemName : '',
tags : []
};
$scope.perPage = 3;
$scope.page = 1;
$scope.sort = {
name: 1
};
$scope.orderProperty = '1';
$scope.searchText = '';
this.helpers({
items: () => {
return Items.find({}, { sort : $scope.getReactively('sort') });
},
isLoggedIn: () => {
return Meteor.userId() !== null;
},
currentUserId: () => {
return Meteor.userId();
},
images: () => {
return Images.find({});
}
});
this.subscribe('images');
this.subscribe('myItems', () => {
return [
{
limit: parseInt($scope.perPage),
skip: parseInt(($scope.getReactively('page') - 1) * $scope.perPage),
sort: $scope.getReactively('sort')
}
]
});
...
...
I probably missed something during the upgrade but couldn't figure out what.
Thanks for your advices, Burock.
PS, I have about 3 meteor apps now excluding this playground app, all behave the same, subscribe does not return any collections
Have you somewhere some code which is referring to old version as $meteor.objector $auth.requireand so on ?
Because once I rewrite my app entirely with the new API 1.3.6, everything was working again.
Unfortunately I did a file search and found nothing.. I have a suspicion about this package, though...
dburles:mongo-collection-instances upgraded from 0.3.4 to 0.3.5
I also checked server side, when I use getReactively the server is not triggered despite I can see on the client that it requests and it does return empty collection. I dont want to reset mongodb assuming that's not effected.
Thanks burock
I'm experiencing the same problem. The issue seems somehow related to the package [email protected] .
@burock @dapids can you provide the actual app so I can try it locally?
Thanks
you can try mine from here: https://ide.c9.io/eba_sfdc/booker
thanks
Same here. seems somehow related to the package [email protected]. After update this package and angular package from 1.3.5 to 1.3.6 it occurred.
One interesting thing here, this occur only when my publish have more than one cursor.
Can it be this line by ozsay on an update to angular-meteor-data where he renames angular-meteor.utils as:
'angular-meteor.utilities',
but under angular meteor packages it is actualy still utils..
@burock There are 2 modules for utilities. One legacy and one for current code.
ok.. saw it.. sorry, was reading the code.. i'll be more careful.
it's ok :) we are all here to help.
BTW can you clone the repo from c9 to github so I could look at it ?
here it is.. if you've a c9 user the one over there is already public https://ide.c9.io/eba_sfdc/booker ..
thanks burock
@dotansimha,
Thanks for your help. Unfortunately I can't share my app.
I'll try to give more details as soon as I can.
Cheers.
@burock I have the same problem on 1.3.7 --
as a temporary solution, removing the line
$reactive(this).attach($scope);
and replacing this with $scope in the controller seems to fix it.
yep, thanks a lot @jeroensmeets .. Commenting out that line $reactive(this) did really solve.
But, I think I will still stick with version 1.3.4 which looks the most stable, since the docs/tutorials and usage seem to be out-of-sync.
Cheers,
still got some problems randomly with subscriptions in 1.3.7 when a user is logged
Related to #1272
@Urigo It's a $scope - controller mixing thing. This issue can be closed because the other one is much more readable :eyeglasses:
great, closing