Is it "guaranteed" that a Meteor method will be executed on server-side?


#1

My scenario is a mobile application which typically has an unreliable network connection. What will happen if a Meteor.call() fails to contact the server? Will there be infinite tries, or does Meteor “give up” after a while?

An additional question regarding usability in this context: Assuming that Meteor gives up after n tries and calls the provided callback with an error. How do you typically deal with this situation if you have implemented latency compensation and the user has been re-routed to other pages in the meantime? Do you implement a kind of “in-app notification system” to inform the user about the failed server response? How do you deal with situations where the user closes the application before the Method has been successfully sent?

My scenario is a page where the user may attach tags to model objects. If the user adds tags that are new to the application, they should be reviewed by a moderator. So I will call a Meteor.method() to trigger this approval process, but if it cannot be assured that the message will be delivered, the user might wait “forever” for this.


#2

No, its not.

Look into Simulation mode: http://docs.meteor.com/#/full/meteor_methods

Short Answer: Methods (unless they are in a server block) run on both the Client and Server, with the Client “simulating” the response and waiting for the Server to respond.

You’re going to want to use the Asynchronous Method.call function and be ready to capture any errors/timeouts.


#3

Why not just wrap your Meteor.call() inside another method that first checks connectivity status? Meteor.RPC().