Hi guys! something weird happened to me yesterday and id like to know if anyone can explain why it happen.
Im using react with meteor. In client i called the meteor method like that:
Meteor.call('tasks.update', {'jobos':fields.jobos, material:true})
on the server i have this method
'tasks.update'(valor) {
check(valor, Object);
const taskId = Tasks.findOne({'jobos':valor.jobos});
console.log('1',valor, taskId)
if (taskId === undefined) {
console.log('2',valor, taskId)
throw new Meteor.Error('TASK DIDNT FOUND');
}else{
console.log('3',valor, taskId)
Tasks.update(taskId, { $set: valor });
}
}
when i execute the method i receive different log back on either client and server .
On the client (chrome) it logs:
1 {jobos: “000001.0”, material: true} undefined tasks.js:62
2 {jobos: “000001.0”, material: true} undefined tasks.js:64
meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:1061 Exception while simulating the effect of invoking ‘tasks.update’ errorClass {isClientSafe: true, error: “TASK DIDNT FOUND”, reason: undefined, details: undefined, message: “[TASK DIDNT FOUND]”, …}
On the DOS meteor server it logs:
1 { jobos: ‘000001.0’, material: true } { _id: ‘rBT3RH3sZdrS52oFZ’,
jobos: ‘000001.0’,
verba: true,
prestacao: false,
trello: false,
nf: false,
material: false }
3 { jobos: ‘000001.0’, material: true } { _id: ‘rBT3RH3sZdrS52oFZ’,
jobos: ‘000001.0’,
verba: true,
prestacao: false,
trello: false,
nf: false,
material: false }
and my mongo updates.
The question is, why the same console.log its showing different information on both sides.
by the way my mongo was updated.
Can anyone help me understand that?
thank you!!!