webperf-snippets
webperf-snippets copied to clipboard
Log wrong interactions.
https://github.com/nucliweb/webperf-snippets/blob/080be73765c85975fb0ba1c063d0f94a19e506fd/pages/Interaction/Interactions.mdx#L26
Please check the snippet for interaction:
I see that this snippet logs interaction only with interactionId = 0, and it seems to be wrong, according to documentation and example here: https://web.dev/articles/diagnose-slow-interactions-in-the-lab?hl=pl#use_a_javascript_snippet
We should log with interactionId > 0.
This line:
.filter((entry) => !entry.interactionId)) {
It's the same that this line:
if (!entry.interactionId) continue;
Yes,
But You filter interactions with interactionID = 0. It gets only interaction without ID. The documentation says that only interactions with ID are made by user
if (!entry.interactionId) continue;
Here, We are in for loop, when interactionID is 0 they continue and don't log this interaction.
When I use snippets from web.dev and Your at the same time, I see logs in console only from snippet from web.dev.