-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meteor 3.0 potential bug #445
Comments
Thank you for submitting this issue! We, the Members of Meteor Community Packages take every issue seriously. However, we contribute to these packages mostly in our free time. If you think this issue is trivial to solve, don't hesitate to submit Please also consider sponsoring the maintainers of the package. |
Here's the relevant code associated with your problem: // If async is supported and fibers are disabled
// wait for db operation promise to resolve
// else just run the sync version as is
if (async && !Meteor.isFibersDisabled) {
try {
this[methodName.replace('Async', '')].isCalledFromAsync = true;
_super.isCalledFromAsync = true;
return Promise.resolve(_super.apply(this, args)); <--- wait for db operation here
} catch (err) {
const addValidationErrorsPropName =
typeof validationContext.addValidationErrors === 'function'
? 'addValidationErrors'
: 'addInvalidKeys';
parsingServerError([err], validationContext, addValidationErrorsPropName);
error = getErrorObject(validationContext, err.message, err.code);
return Promise.reject(error);
}
} else {
return _super.apply(this, args); <--- run sync version as is
} With that being said I don't see an problem inherently with an error being thrown out. You're not meant to be using sync DB calls on Meteor 3.0, duh! Moreover, it's in your best interest for an error to be thrown out so you can tell what's DB call failed instead of failing silently. The best we can strive for is to beautify the error but IMO the error is informant as is, it doesn't get better than this. Error: update + is not available on the server. Please use updateAsync() instead. Let me know what you think, otherwise I'm closing this issue. |
The problem though is that we weren't using any sync call on the server or client. Unless there was something in a package that we couldn't locate. |
hmmm, can you provide a replication of this bug? I was going simply by the error message you provided. |
I'm now thinking this could be related to this: meteor/meteor#12978 While the current solution is technically correct, I don't think that it is a best behavior for collection2. I'll look more into this as I work on reproduction. |
Ok, keep me posted. |
@harryadel is this something that needs to be fixed for 3.0 or is this an edge case? |
As reported in Slack by @StorytellerCZ :
If I add
to line 236 in
main.js
it goes away. Probably not the best approach though.The text was updated successfully, but these errors were encountered: