-
Notifications
You must be signed in to change notification settings - Fork 455
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
Subsequent email_data() calls in observers return empty objects #18
Comments
@jamiebikies thanks for noticing this. So the first thing |
Hey @KartikTalwar, the delay is exactly what I've done for now. I'll take a look and submit a PR if you haven't got to it and I come up with a good way, like you said, to do it without a delay. |
@jamiebikies so the problem is that the observe callback gets executed right after its triggered. So when your callback requests the gmail.observe.on('open_email', function(id) {
var data = gmail.get.email_data(id);
console.log(data);
}); Feel free to reopen this issue if you find any inconsistencies |
@KartikTalwar @jamiebikies i added above code in my script but still empty object got..but first time i got data but if i open email 2nd onwards then empty object got.Now i m using https://xmailchrome.appspot.com/gmail.js link gmail.js in my script. Can you tell me where i did wrong? |
@sweetaai that js file is very outdated. It most likely does not have the fix from this issue. Please host gmail.js yourself so you can keep better track of code changes. |
@KartikTalwar when i added below code in load.js then working fine.
but when added |
@sweetaai the url is not a valid https url. I would recommend you host it on amazon s3 . |
@KartikTalwar |
If I use a
gmail.get.email_data()
inside anopen_email
observer it works the first time but in subsequent email opens, the email_data() returns an empty object. Some sort of race condition perhaps?The text was updated successfully, but these errors were encountered: