When a relation has an invalid end date, it isn’t possible to save edits to its members, and panning the map causes lots of tearing. An error message appears in the console repeatedly.
The map stutters, and the following error appears repeatedly in the browser console:
Uncaught RangeError: date value is not finite in DateTimeFormat.formatRangeToParts()
utilDisplayName util.js:205
drawLabels labels.js:315
call_default call.js:4
drawEditable map.js:395
redraw map.js:690
Lodash 3
map2 map.js:132
call dispatch.js:57
merge history.js:133
afterLoad context.js:138
tileCallback osm.js:1132
handle osm.js:279
util.js:205:31
Diagnosis
The boundary relation for New Mexico Territory is tagged end_date=1912091095. This date is invalid according to ISO 8601. It should probably be 1912-01-05 based on the last member.
Anyhow, iD should not choke so hard on an invalid date. The error is thrown here when we attempt to pass an invalid Date object into Intl.DateTimeFormat.formatRangeToParts():
When a relation has an invalid end date, it isn’t possible to save edits to its members, and panning the map causes lots of tearing. An error message appears in the console repeatedly.
Steps to reproduce
Expected results
The map pans normally.
Actual results
The map stutters, and the following error appears repeatedly in the browser console:
Diagnosis
The boundary relation for New Mexico Territory is tagged
end_date=1912091095
. This date is invalid according to ISO 8601. It should probably be1912-01-05
based on the last member.Anyhow, iD should not choke so hard on an invalid date. The error is thrown here when we attempt to pass an invalid
Date
object intoIntl.DateTimeFormat.formatRangeToParts()
:https://github.com/OpenHistoricalMap/iD/blob/a5a46ae34e3eef0ba5b69e7f89d7834fc3c5073d/modules/util/util.js#L205
But
utilNormalizeDateString()
shouldn’t even have returned a value if itsdate
is invalid:https://github.com/OpenHistoricalMap/iD/blob/a5a46ae34e3eef0ba5b69e7f89d7834fc3c5073d/modules/util/date.js#L69-L72
Thanks to @txemt1 for spotting and reporting this issue!