profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Marker payload data has no runtime type checks

Open PaulBone opened this issue 7 years ago • 3 comments

When markers are loaded (from JSON) into perf, they have no runtime type checks or conversions on their contents. So while flow believes that certain fields have certain types, they don't necessarily. For example a lot of time fields are Numbers (Milliseconds) but in the JSON data are actually strings, nothing converts them from strings to numbers when they're loaded.

┆Issue is synchronized with this Jira Task

PaulBone avatar Mar 20 '18 10:03 PaulBone

For example a lot of time fields are Numbers (Milliseconds) but in the JSON data are actually strings, nothing converts them from strings to numbers when they're loaded.

This is actually bad if what we get isn't what we think it is...

julienw avatar Mar 20 '18 12:03 julienw

We should do this work either in an upgrader, or correct our flow type definitions. Thanks for the issue Paul.

gregtatum avatar Mar 20 '18 14:03 gregtatum

An upgrader will only solve part of the problem. There is still no runtime check on the upgraded data being read. So a buggy upgrader could place data into the file that still doesn't match the flow types.

PaulBone avatar Apr 11 '18 04:04 PaulBone