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

Paint metrics are reported when page starts off in a hidden state #153

Open
kylewm opened this issue Jan 29, 2021 · 1 comment
Open

Paint metrics are reported when page starts off in a hidden state #153

kylewm opened this issue Jan 29, 2021 · 1 comment
Assignees
Labels

Comments

@kylewm
Copy link

kylewm commented Jan 29, 2021

Hi! I noticed a bug in my own application's metric tracking this morning, went to check how Perfume solved it, and I think I found that Perfume has the same bug:

If I open a link in a new tab, wait a few seconds, and then switch to the tab, FCP and LCP are still reported, but the duration is the time I waited before switching to the tab.

I believe this is because visibility.isHidden is only set to true by a visibilitychange event, and in this case there is no event fired until I switch to the tab and page becomes visible.

Here's a simple example demonstrating the issue: https://kylewm.github.io/perfume-demo/

Jan-29-2021 11-21-57

@Zizzamia
Copy link
Owner

Zizzamia commented May 5, 2021

Oh interesting, great catch! I will do some more investigation on this and see how to fix it.
If you have any idea on how to, feel free to open a PR.

@Zizzamia Zizzamia self-assigned this May 5, 2021
@Zizzamia Zizzamia added the fix label May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants