[Solved] Meteor.call not working after reconnect


#1

As the title says, we have an app that seems to have stopped making Meteor method calls after disconnecting and reconnecting.

We make use of the nspangler:autorecconect package, which seems to be working fine as far as I can tell.
The app UI becomes disabled with a “waiting for server” dialog while disconnected (as it should) and then the dialog goes away when it reconnects. I get a client-side console log when the recconect happens and I also added a Meteor.onReconnect to my server to verify that the connection was actually happening (it is, but with a different id than the initial connection, if it matters).

I added some console logs and was able to determine that after the reconnect, the method called by Meteor.call was never firing on the server and I also was never making it into the callback on the client side.

I’ve tested in as many ways as I can think of:

  • calling Meteor.disconnect() and then Meteor.reconnect()
  • Manually turning off local development server as well as production server then turning back on
  • Turning off WiFi while connected to prod app and then turning wifi back on

Regardless of the method, the result is the same. After reconnecting, I am unable to call Meteor methods using meteor.call. It seems like they are never making it to the server.

I’m happy to provide any more information that I can.
Does anyone have any suggestions that I might try?


#2

Resolved

In a recent refactor, I had removed the default return statement from one of my publications accidentally. As far as I can tell, this completely broke the Meteor calls after a disconnect and reconnect.

Luckily I was able to roll back through recent commits and nail down a small set of changes that the issue seemed to stem from - I’m not sure how else I would have ever found it.

I hope my struggles can benefit someone in the future.