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

"view_email" event fires twice #778

Closed
kaeevans opened this issue Feb 23, 2024 · 1 comment
Closed

"view_email" event fires twice #778

kaeevans opened this issue Feb 23, 2024 · 1 comment

Comments

@kaeevans
Copy link

Issue:
"view_email" fires twice when I open an email from the inbox.
I am using the boilerplate code from the gmailjs-node-boilerplate repo.

Solution tried:
I followed the debugging instructions in issue 526 and confirmed that the "view_email" event-handler is only registered once. The call stack is the same each time "view_email" fires:
IMG_7012

Have you seen this before? Do you know what might be causing it?

@josteink
Copy link
Collaborator

This kind of seems to be a duplicate of #765.

The email_view and thread_view events has always been ... not extremely deterministic, due to how Gmail does rendering, pre-rendering etc. And new gmail has made things even more "interesting".

There's no "proper" fix for this yet, and the simplest way to deal with this is simply making your event-handling code idempotent (i.e. triggering the same event multiple times results in the same outcome as triggering it once), as suggested in the linked thread.

Closing this issue, as duplicate.

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

No branches or pull requests

2 participants