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

Only attempt to clear measures if we created the measure #9451

Merged
merged 1 commit into from
Apr 18, 2017

Conversation

chrisui
Copy link
Contributor

@chrisui chrisui commented Apr 18, 2017

This fixes an issue where if we decided not to create a measurement we would clear ALL measurements from the performance entry buffer due to passing undefined as the entry name.

The original bug here means any performance entries the user might have in their application will be inadvertently nuked.

For reference see the performance.clearMeasures spec.

Todo

  • Test/s incoming (would love some help in finding where to add such a test!)

This fixes an issue where if we decided not to create a measurement we would clear ALL measurements from the performance entry buffer due to passing `undefined` as the entry name.
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

@chrisui
Copy link
Contributor Author

chrisui commented Apr 18, 2017

Would love some assistance in targeting where to add a test for this. Can't seem to find any existing tests to add a new case to.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Apr 18, 2017

This seems fine as is, thanks! We don’t need a test because this code will be deleted in the next release (the perf integration is in a different place in Fiber). I think the new code doesn’t have this issue, but you can check ReactDebugFiberPerf to make sure.

I’ll make a note to cherry-pick this commit in 15.6.

@gaearon gaearon merged commit f6c4fe6 into facebook:master Apr 18, 2017
@gaearon gaearon added this to the 15-hipri milestone Apr 18, 2017
@flarnie flarnie mentioned this pull request Apr 18, 2017
49 tasks
@chrisui
Copy link
Contributor Author

chrisui commented Apr 18, 2017

@gaearon Thanks for the quick turnaround Dan!

flarnie pushed a commit that referenced this pull request Apr 20, 2017
This fixes an issue where if we decided not to create a measurement we would clear ALL measurements from the performance entry buffer due to passing `undefined` as the entry name.
flarnie pushed a commit to flarnie/react that referenced this pull request Jun 7, 2017
This fixes an issue where if we decided not to create a measurement we would clear ALL measurements from the performance entry buffer due to passing `undefined` as the entry name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants