USACE / instrumentation

Instrumentation project issue tracking and project planning
MIT License
5 stars 1 forks source link

Crash Upon Accessing/Creating Collection Group #18

Closed lucasb16-exe closed 3 years ago

lucasb16-exe commented 3 years ago

CollectionGroupError Application crashes to white screen when attempting to create or access a collection group. See attached screenshot with error.

RangeError: Invalid time value

Not sure where a date object is getting passed containing an invalid date when just accessing a collection group

If any other information is needed let me know, any input would be appreciated -Lucas

jeffsuperglide commented 3 years ago

Looked at "Indiana Harbor" with @lucasb16-exe on this issue and it was reproducible. I then tested Collection Groups for Buffalo District Streamgages. Successfully added a group and timeseries to that group. First difference between the two tested is Buffalo has data in timeseries and Indiana does not. Further investigation into Collection Groups for projects without data.

lucasb16-exe commented 3 years ago

Found source of error in collectiongroup-timeseries-list.js line 52.

Looks like item.latest_time is passed into parseISO() without a check to see if it exists, if a timeseries selected for a collection group doesn't have any data, null value will be passed in causing crash.

Signing off for today, will fix via ternary tomorrow morning and pull.

lucasb16-exe commented 3 years ago

Potential fix - line 52 -> {item.latest_time != null ? formatDistanceToNow(parseISO(item.latest_time)) + ' ago' : 'No Data Found'}