Zizzamia / perfume.js

Web performance library for measuring all performance vitals metrics
https://zizzamia.github.io/perfume/
MIT License
3.12k stars 109 forks source link

Added extra check for undefined values #260

Closed Cdub-9 closed 7 months ago

Cdub-9 commented 7 months ago

Encountered a race condition that occurred occasionally when multiple marks were being fired off at similar times, as a result the WP.measure(stepMetricName, M + startMark, M + endMark); would sometimes return undefined, and then cause an undefined type error.

Added back in the async/await into calling measureStep and added an extra check to ensure null durations are handled

New Test Coverage - we can see the new return being tested since measureStep.ts is at 100%

image