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

Randomly gmail.observe not firing #11

Open
itsazzad opened this issue Feb 18, 2016 · 2 comments
Open

Randomly gmail.observe not firing #11

itsazzad opened this issue Feb 18, 2016 · 2 comments

Comments

@itsazzad
Copy link
Contributor

view_email, refresh, etc are not firing occasionally if the console is not open.
In that case it can get the email address here:

console.log('Hello,', gmail.get.user_email())
but after that I have put all other observers which are not firing...
But if I refresh the page then its firing.

@KartikTalwar
Copy link
Owner

hey @itsazzad would it be possible to get the steps you are following to reproduce it? When I try it on my browser, it works fine.

@itsazzad
Copy link
Contributor Author

Here is the code I use. The point is that it works always except in a very few random occasions. I am not sure about the occasion. Do you have any idea that how can it can get the email address but not starting the observers? Here it will get the email address and if it not match then will alert me and after that always should have starting the observers like as refresh or http_event but seldom its not either starting the observers because I am not getting anything in the log...

var main = function() {
  gmail = new Gmail();
  console.log('Hello,', gmail.get.user_email());
  var acceptable_emails = [ "example1@gmail.com", "example2@gmail.com" ];
  if (jQuery.inArray(gmail.get.user_email(), acceptable_emails) >= 0) {
  } else {
    alert('Sorry! Your email is not associated with this system.');
    return false;
  }

  gmail.observe.on("refresh", function(url, body, data, xhr) {
    console.log("gmail.observe.on:refresh- url:", url, 'body', body, 'data', data, 'xhr', xhr);
  });

  gmail.observe.on("http_event", function(params) {
    console.log("gmail.observe.on:http_event- url data:", params);
  });
}
refresh(main);

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

2 participants