Open rukshn opened 3 years ago
Hey there and thanks for reporting!
I'm honestly not sure, but it might be the same phenomena we're seeing with the view_email
event, which is documented:
https://github.com/KartikTalwar/gmail.js#gmailobserveonaction-callback
If that's how open_email
works too now (gmail keeps changing, after all), it might be a good idea to update the documentation with that information too.
If you want to look into why this happens and try to create a fix, I'm open to reviewing that, but I won't be investigating that myself, as I don't rely on that event for any of my production-extensions.
Yes I'll try to see if there is a possible fix, but since both are not working (open and view email) it's really hard to catch an email open
In my extension I've relied on detecting hash-changes in the URL, with check for current-email as a more reliable check for "view email" kind of events.
It's clearly a work-around, but maybe it can work for you too?
Yes that feels like a better and a reliable way than the current implementation
How are you looking for the hash change? by using an event listener? or does GmailJs provide a function for that?
MDN has the answer :)
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange
The open email observer is only fired once.
When running the following observer, it is only fired once when an email is opened, and will not fire again on subsequent openings of the same email. Any reason why and how to fix it?
Thanks