-
Notifications
You must be signed in to change notification settings - Fork 123
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
fix: report requests even without timing #1386
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +912 B (+0.08%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
start?: number | ||
end?: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to make these optional? Looks like this method is only called with the results of window.performance.now()
as inputs for these values which always returns a number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only that the values start undefined... really you shouldn't ever get to the point of needing them and the value not be present but 🙈
Co-authored-by: David Newell <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test we could write that would simulate the missing performance entry?
(Separately, but somewhat related to this change) I was looking at the reported issue where the performance events were missing for a customer. Given we initialise our own PerformanceObserver maybe we could store the events it captures and use that as a lookup guide instead of the |
playing with more testing of the network recorder at the moment... i'm sort of worried that this suffers a common problem of this kind of "wrapping external APIs" code. either the scaffolding is complex or we split things so that we can test the behaviour and we lose all encapsulation 🙈 |
🤔 |
I'll wait and get #1395 in before this so we at least have one more level of testing on top of it |
related to https://posthoghelp.zendesk.com/agent/tickets/16517
In that ticket xhr calls to an API are not being recorded.
ultimately this is because if there is no performance entry reported by the browser we don't send any information back to posthog :/ no bueno
In that site I can capture those calls with a performance observer by pasting the following in the terminal
that's not quite how the recorder works but should be equivalent
but when we try to get the call in the recorder none is returned
i can't see any code in the site calling
performance.clearResourceTimings()
but the existence of
performance.clearResourceTimings
means we can't guarantee timings are available anyway.so we should report what we can
maybe we should
tested locally and can still capture performance data and network payloads/headers