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

🐛 [RUMF-931] check if PerformanceEntry is defined before using it #891

Merged
merged 3 commits into from
Jun 14, 2021

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Jun 14, 2021

Motivation

When implementing #883, we needed to use the global PerformanceEntry class. This class is not supported in Safari 10 and below.
Fix #890

Changes

Check if PerformanceEntry is defined before using it.

Testing

CI, manual (browser stack live with Safari 10)

Note

This should have been an internal error, but because of the await used in the fetchProxy, it ends up as an "unhandled rejection" (anything executed after the await is not "monitored"). We should address this issue in a separate PR.


I have gone over the contributing documentation.

Cast was needed because types are now more precise (no more implicit
`any`) and didn't match the context anymore.
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner June 14, 2021 10:38
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2021

Codecov Report

Merging #891 (2329f80) into main (a846216) will decrease coverage by 0.01%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #891      +/-   ##
==========================================
- Coverage   89.14%   89.13%   -0.02%     
==========================================
  Files          81       81              
  Lines        3804     3809       +5     
  Branches      850      850              
==========================================
+ Hits         3391     3395       +4     
- Misses        413      414       +1     
Impacted Files Coverage Δ
...rumEventsCollection/resource/resourceCollection.ts 97.22% <80.00%> (-2.78%) ⬇️
...ages/rum-core/src/browser/performanceCollection.ts 14.89% <100.00%> (+1.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a846216...2329f80. Read the comment docs.

@BenoitZugmeyer BenoitZugmeyer merged commit c7a0178 into main Jun 14, 2021
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/fix-performance-entry-detection-in-safari branch June 14, 2021 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReferenceError Can't find variable: PerformanceEntry error on MacOS Safari and Mobile Safari
4 participants