137 Commits

Author SHA1 Message Date
Martin Raifer
49e895e2ed log failed API requests in console
to more easily debug API issues in the future
2025-03-11 15:49:56 +01:00
Martin Raifer
91aa85a1c0 better handling of rate limited API map calls and other API errors
* retry all unsuccessful map calls after waiting 8 seconds (spinner continues to indicate loading state)
* also logged-in users can be rate limited: add dedicated error message
* don't log users out when requests return 401/403 (except on the _get own user data_ request, which would indicate that the oauth token was revoked): it's better to show the error message if a legitimate api call was actually unauthorized

closes #10299
2025-03-11 15:40:05 +01:00
Kyℓe Hensel
7beace6698 add a changeset tag if a merge conflict occurred (#9636) 2025-03-05 12:38:32 +01:00
Martin Raifer
121f3e2fb8 don't reauthenticate on HTTP 400 errors
since these are likely unrelated to authentication issues, but rather have to do with generic API errors or outages
2025-02-11 16:29:01 +01:00
Kyℓe Hensel
add513f39e fix confusing behaviour after logging out in the standalone build of iD (#10683)
when user logs out of osm.org via the logout button: the popup continues to the login screen, which if completed now logs the user back into iD with the new credentials
2025-01-22 17:25:56 +01:00
Martin Raifer
b2b3009a64 .env oauth2 config: drop client secret; use URL if API_URL is empty 2024-07-05 16:15:47 +02:00
Martin Raifer
9c6b7251f5 Merge remote-tracking branch 'k-yle/3595-localised-auth-popup' into develop 2024-05-27 12:47:11 +02:00
Martin Raifer
211b6dde5f upgrade to eslintv9 (config format, lint to updated rules) 2024-04-12 18:44:04 +02:00
Kyle Hensel
8889118f03 set the locale of the login popup 2024-02-22 21:15:39 +11:00
Martin Raifer
aaf89d7755 don't duplicate notes which have already been seen 2024-01-24 15:16:12 +01:00
NaVis0mple
59668638ac Search OSM notes by ID (#10062) 2024-01-24 13:32:35 +01:00
Martin Raifer
87a05f5815 migrate to osm-auth 2.3 2023-11-14 08:13:44 +01:00
Martin Raifer
accbdf35d2 use api.osm.org also for map calls, release as v2.27.3 2023-11-08 12:32:40 +01:00
Martin Raifer
c4d1390270 use api.osm.org url for OSM API calls
see https://github.com/openstreetmap/operations/issues/951
2023-10-10 16:03:10 +02:00
Martin Raifer
41aa127d23 reduce use of parseFloat
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)
2022-11-24 19:39:15 +01:00
Martin Raifer
c8a3cf154b make more cdn's and API urls/settings configurable
* CDNs for OCI, NSI, etc.
* OSM API (URL and oauth API settings)
* taginfo API
* nominatim API
2022-10-14 19:19:29 +02:00
Martin Raifer
280acfa661 Replace RapiD credentials with iD credentials 2022-06-02 14:46:11 +02:00
Bryan Housel
34a2af0330 Give user the opportunity to switch users when logging out
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.
2022-06-02 13:29:41 +02:00
Bryan Housel
6058f89460 Upgrade to osm-auth v2 which uses OAuth2 to connect to OSM API 2022-06-02 13:07:50 +02:00
Minh Nguyễn
3956b4415f Escape user name in profile URL 2021-11-17 18:18:08 -08:00
Bryan Housel
f195128968 Fix a few errors in note processing
- 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`)
2021-01-21 14:29:17 -05:00
Quincy Morgan
f8ddfa9224 Use JSON for user and users endpoints (close #8188) 2020-11-10 12:46:43 -05:00
Quincy Morgan
481b80e5cb Fetch the parent relations when downloading a single entity, e.g. when launching iD with a feature selected (close #6731) 2020-11-10 10:00:44 -05:00
Quincy Morgan
380473033b Enable no-duplicate-imports eslint rule 2020-10-23 12:02:37 -04:00
Quincy Morgan
03ca12741f Make imageryBlocklists return regex objects instead of strings
Fix performance bug due to checking background source blocks too often
2020-09-04 10:09:47 -04:00
Quincy Morgan
a72a2bb860 Hide background sources from the list if they're blocked (close #7905) 2020-09-03 12:30:59 -04:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00
Quincy Morgan
0e0148b8f2 Fix JS error caused by possible undefined uid of entities returned by OSM API (close #7858)
Add additional safety checks for undefined entity `version` or `changeset`
2020-07-30 15:45:56 -04:00
Quincy Morgan
8b258d2cbd Load the maximum nodes per way value from the OSM API and add a getter to the service object
Disable the Merge operation if the resultant way would have more than the maximum number of nodes (close #6030)
Simplify some code in operationMerge
2020-06-08 14:38:49 -04:00
Quincy Morgan
bf7b30ace9 Fix unreleased regression where OSM notes were being parsed as JSON and thus not loading (re: #7188) 2020-06-08 13:19:46 -04:00
Quincy Morgan
207badb1a0 Read object visible state when parsing JSON API response (re: #7188) 2020-03-10 09:35:33 -07:00
Quincy Morgan
52222df75f Switch to JSON endpoints of OSM API for fetching entities (re: #3765) 2020-03-02 15:54:46 -08:00
Quincy Morgan
89ce98f510 Don't require services/osm in order to get max OSM character lengths 2020-01-28 09:28:23 -05:00
Quincy Morgan
17ae12b3d7 Address most common places where tag keys or values could exceed the 255 character API limit (close #6817) 2020-01-27 15:57:55 -05:00
Quincy Morgan
d6419ca791 Move OSM tile fetch callback to a named function 2020-01-16 10:29:17 -05:00
Quincy Morgan
37351e0f50 Include the number of active blocks in the OSM user object 2020-01-16 10:19:59 -05:00
mmd-osm
b7ca22f41d OSM API /map call - Overpass JSON format parser 2019-12-27 20:50:47 +01:00
Quincy Morgan
c1f7721197 Reload API status automatically when a response indicates a probable change in status (close #6650)
Make API status messages more informative (close #7021)
Add manual Retry button to "unable to connect" API status message (close #5864)
2019-12-05 17:17:57 -05:00
Quincy Morgan
271a4cbac7 Update rbush to 3.0.1 (close #6359) 2019-11-08 18:17:17 +01:00
Bryan Housel
0ded25885d Back off if the toLoad queue is filling up..
(re #6417)
2019-05-24 09:44:35 -04:00
Bryan Housel
bdb454e1b3 Remove utilCallWhenIdle, use requestIdleCallback/cancelIdleCallback
Places where a reset or connection switch would be problematic,
we can now cancel the callbacks.
2019-05-16 22:28:56 -04:00
Bryan Housel
a8c6ab4d67 Move requestIdleCallback polyfill to id.js, remove utilIdleWorker
`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.
2019-05-16 21:19:25 -04:00
Bryan Housel
b48a7d1e1b Workround for status errors thrown by d3-xml
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.
2019-04-26 22:23:08 -04:00
Bryan Housel
b99be67169 When calling an errback from a Promise.catch, pass err.message 2019-04-25 21:58:36 -04:00
Bryan Housel
e6bc9d9e8f Swap out d3-request, swap in d3-fetch 2019-04-24 16:25:25 -04:00
Bryan Housel
e30090996b Add loadTileAtLoc to fetch data tile for a specific location
(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.
2019-04-09 23:49:31 -04:00
Bryan Housel
2660a8554b Add isDataLoaded and tilecache rtree for testing
(re: #2248, #5938, maybe others)
2019-04-08 15:59:42 -04:00
Bryan Housel
3673a7c7e7 Remove lodash cloneDeep
(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()))
2019-03-29 17:18:40 -04:00
Bryan Housel
4a8c20c56e Remove lodash forEach
(re: 6087)
2019-03-28 19:50:20 -04:00
Bryan Housel
3d80e6505f Remove lodash chunk, groupBy
(re: #6087)
2019-03-27 16:18:41 -04:00