Im stuck trying to debug a Meteor method in the server side. When debugging in the client (in Chrome) the debugger executes until the 4th line of the code below ("Meteor.call") and immediately return to the 2nd line ("convlist:function()") avoiding the 2nd debugger instruction. No error in client/server consoles. I also have the server side debugger but the running process never jump to it (Server debug in http://localhost:8080/debug?port=5858). Any advice will be appreciated.
Client Side:
Template.conversationList.helpers({
convlist: function(){
debugger;
Meteor.call('getConvList', function(error, result){
if(error){
alert('Error');
} else {
debugger; // just to evaluate the result var
return result;
}
});
//edited 3rd debugger;
debugger;
}});
Server Side:
if (Meteor.isServer) {
Meteor.methods({
getConvList: function(){
debugger;
let myUser = new Array();
myUser.push(Meteor.user()._id);
var newConv = Conversations.aggregate([{ "$match" : { "users": {"$in": [Meteor.user()._id]}}}, { "$project": { lstmsg:1, "conversator": {"$setDifference": ["$users", myUser] }}}]);
return newConv;
}
});
}