Skip to content
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] Server-only Method displays "Method stub took too long" warning in browser console when using Meteor.callAsync #12999

Closed
jamauro opened this issue Feb 5, 2024 · 3 comments · Fixed by #13055
Labels
confirmed We want to fix or implement it Meteor 3 relates to Meteor 3
Milestone

Comments

@jamauro
Copy link
Contributor

jamauro commented Feb 5, 2024

Version: Meteor 3.0-beta.0

I have a server-only Method that I'm calling, i.e. it has no stub, but I'm seeing this warning in the browser console when I use Meteor.callAsync. If I use Meteor.applyAsync, I don't see the warning.

[Warning] Method stub (updateLink) took too long and could cause unexpected problems. Learn more at https://github.com/zodern/fix-async-stubs/#limitations (ddp-client.js, line 245)

Expected: I shouldn't see a stub warning if the Method doesn't have a stub. Also I don't think I should see this warning even if it were stubbed.

Here's the Method on the server:

// /server/main.js
import { Links } from '/imports/api/links';

const updateLink = async () => {
  const { _id } = await Links.findOneAsync() || {};
  return Links.updateAsync({ _id }, { $set: { title: 'hello' }});
};

Meteor.methods({ updateLink })
// on the client

const updateLink = async () => {
  try {
    await Meteor.callAsync('updateLink');
  } catch (error) {
    console.error(error)
  }
};
@Grubba27 Grubba27 added this to the Release 3.0 milestone Feb 29, 2024
@nachocodoner nachocodoner added confirmed We want to fix or implement it Meteor 3 relates to Meteor 3 labels Mar 11, 2024
@nachocodoner
Copy link
Member

This is going to be fixed here, #13055

@StorytellerCZ
Copy link
Collaborator

@nachocodoner can this now be closed?

@nachocodoner
Copy link
Member

Yes, it is fixed and included on the next beta. Ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed We want to fix or implement it Meteor 3 relates to Meteor 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants