IFrame method integration failing intermittently

Hi,

I have implemented integration using the IFrame integration. I explicitly logout the user when he leaves the page. After the user comes back to the page we I am getting

Uncaught Error: Methods should only receive results once

How to solve this ?

Thank you.

I’m having a similar/related problem (same error message) but without using IFrames.

In my case I’m using standard email/password authentication. Whenever a logged-in user disconnects from the RC server and then reconnects, the client attempts to log the user in again immediately after the reconnect using the login token in the browser’s localStorage (if one exists).

If there is an error during that auto-login process, the user will not be logged in. If they were previously logged in, they will be logged out (which is what’s happening in my case - the user who was previously logged in is sometimes getting logged out immediately after reconnecting).

I’ve been looking into the source code for the accounts-base package which handles all the common auth logic. I’ll reply here when I find the cause of the issue since there’s a good chance it will be the same solution for you.

So upon further troubleshooting, this appears to be due to a couple bugs in Meteor’s DDP client code. I’ve just opened a ticket with Meteor here:

I’m still trying to figure out the 2nd bug I mention in that ticket (why currentMethodBlock is sometimes missing the method invoker for the corresponding DDP result message). I’ll post another update here when I’ve got that sorted out, hopefully later today since it’s a blocker on my current RC project.

Once I have a solution, we should be able to implement it right away by putting the fixed version of ddp-client into the /packages directory of the RC app while waiting for Meteor to fix it on their end.

@aaron.ogle @sing.li just a heads up that this could be affecting other parts of RC: anywhere multiple Meteor method calls are happening in parallel or in quick succession causing intermittent errors/bugs.

UPDATE: I’ve done some more digging and posted my final analysis and workaround here:

The same solution will likely work for this IFrame issue as well.