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

Possible issue with offline event trigger #270

Open
W1nstar opened this issue Oct 31, 2019 · 0 comments
Open

Possible issue with offline event trigger #270

W1nstar opened this issue Oct 31, 2019 · 0 comments

Comments

@W1nstar
Copy link

W1nstar commented Oct 31, 2019

Hello,

I am trying to use the offline event to do some logic on my app. Turns out, it is never called.

In the processPingResult, there's this line:

        if (args.fireEventIfOfflineChange) {
            if (wasOnline && !connectedBeforeCallback) {
                that.trigger("offline", that, args.offlineReason, null);
            } else if (!wasOnline && connectedBeforeCallback) {
                that.trigger("online", that, null);
            }
        }

On my tests, wasOnline and connectedBeforeCallback are both true, therefore it always try to trigger the online event.
My tests are very simple, I just stop OEPAS and hope for the event to trigger, but it does not.
By debugging this _processPingResult function I can see that the function correctly identifies the reason of the ping failur (server offline), but when it evaluates the triggers, it always resorts to trigger online instead of online.

Can you guys confirm it's an error?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant