as it silently strips non-numeric suffixes (e.g. a value of "123 foo" is transformed into a numeric value of 123 by `parseFloat`, which is typically not what we desire)
OAuth2's idea of "logout" is just to get rid of the bearer token.
If we try to "login" again, it will just grab the token again.
What a user probably _really_ expects is to logout of OSM so that they can switch users.
- Notes still load over the xml api, so when the user is not authenticated,
we can't use d3_json to fetch them (instead use to d3_xml)
- Make sure to delete the deferred callback handles once the callbacks are
processed (probably unnecessary, but good housekeeping)
- Remove a stray `if (!json.elements)` block from the `parseUserJSON`
function. This was preventing the user profile from parsing, as the
user's JSON has no such property (was probably copied from `parseJSON`)
`utilIdleWorker` was only used one place.
It just processes a list in an idle callback.
I'm working towards removing the util functions for handling idle work.
We can still do `requestIdleCallback` work throughout the code, however
each place we use it needs to have a strategy for cancellation, which
the existing util functions don't allow for.
Because the done callback is expecting something that has a `status` property,
(like an XHR would), we need to extract the status out of the error message.
d3-xml includes status in the error message, but we can't access the response itself.
(closes#4890)
This lets iD request needed tiles outside of the viewport, for example to
properly straighten lines or validate features that may have unloaded
connections.
(re #6087)
- some were able to do a different approach
(validations/almost_junction, and settings/*)
- some were replaced with custom speedy cloners
(in orthogonalize clonePoints and osm.js cloneNoteCache)
- some just replaced with JSON.parse(JSON.stringify()))
(closes#5200)
This removes a users changes stored in localStorage if they try to close
iD while an upload is in progress. It prevents the possiblity that the
changeset is eventually accepted and closed, but the user can be prompted
to restore those changes the next time they start iD.
Also stringify the note id (because existing notes from OSM are this way)
Also make sure comments is initialized as an Array not an Object
Also clarify some of the tests