Commit Graph

511 Commits

Author SHA1 Message Date
John Firebaugh
053b652548 More typos 2021-10-24 11:06:26 -07:00
John Firebaugh
3e082bb20e Fix typos 2021-10-24 11:01:44 -07:00
Kyle Hensel
d08c09f5ee show an error if local storage is full 2021-09-30 19:41:15 +13:00
Milos Brzakovic
021107cb81 Merge pull request #8642 from openstreetmap/testing_data
Test improvements
2021-09-28 11:08:31 +02:00
Bryan Housel
78961072a7 We do need to actually validate the head entities, can't skip them
re: the fix for #8632 - we can't actually skip validation on these.
The better solution is to move the check to getIssues() so the user isn't
credited for causing the issues unless it's something they actually touched
2021-08-27 17:43:49 -04:00
Bryan Housel
113f079449 Uncache the entity before starting the work
This fixes a situation where several entities in the queue are involved in a
disconnected crossing, and the first one detects the disconnection, but a
later one clears out that first detection from the cache.  Now we clear
caches one time before starting the validation work.
2021-08-27 17:24:45 -04:00
Bryan Housel
b94151396d Expand set of entities to validate to include _related_ to issues
This will catch the situation where an edit or undo affects something related without
actually touching the item - for example an undo can cause a connected way to disconnect
from the main graph.
2021-08-27 17:20:32 -04:00
Bryan Housel
9e3df2c4aa Create an issue key property that changes when data needs refresh
(closes #8655)
2021-08-27 17:13:36 -04:00
Milos Brzakovic (E-Search)
81b7e282c3 Set development version number 2021-08-17 17:14:48 +02:00
Milos Brzakovic (E-Search)
fc5d790b0e v2.20.1 2021-08-17 16:52:28 +02:00
Bryan Housel
1282d3b059 Don't use a util function for a thing that exists 1x in the code 2021-08-16 14:23:24 -04:00
Bryan Housel
bb84962e5d Only insert sources into the fileMap if not already there
This allows us to setup the fileMap correctly for testing so
that it never tries to fetch assets from the CDN.
2021-08-16 13:28:55 -04:00
Bryan Housel
34c3ea472d Credit user with a fix if they touched any involved entity
This can occur if there are several ways disconnected from the graph and
the user fixes these, but then partially undoes their fixes.

The current diff might not contain the entity that fixed the issue
(reconnected the disconnected graph), but they did fix the issue elsewhere.
2021-08-13 15:56:08 -04:00
Bryan Housel
93b868d95f Fix how resolved issues are counted across undo, simplify code
(re: #8632)
2021-08-13 14:47:38 -04:00
Bryan Housel
f58ddb21fb Remove old entityIDsToValidate() code 2021-08-13 12:32:13 -04:00
Bryan Housel
bb0b5786d9 Use context.graph()/context.hasEntity() here, not cache.graph,
because that is the graph that the calling code will be using.
2021-08-13 12:02:38 -04:00
Bryan Housel
2434e5edaa In the head cache, only validate features that the user is responsible for
(closes #8632)

For example, a user can undo some work and an issue will still present in the
head graph, but we don't want to credit the user for causing that issue.
2021-08-13 11:25:36 -04:00
Bryan Housel
3e8d33a668 Use coreDifference.complete() instead of entityIDsToValidate()
From what I can tell, this code is nearly the same as what the "complete"
difference already gives us - combined nodes from both previous and current,
multipolygon members, parents of nodes/relations
2021-08-13 10:53:57 -04:00
Bryan Housel
96c5dd1c7c Store graph with validation cache, give them names, es6 some things 2021-08-12 11:37:57 -04:00
Bryan Housel
a46a345647 Only expand a validation set to include parent multipolygon relations
The previous code was grabbing _all_ parent relations, which is too much.
For example: if a user changed a road, the validator was treating it like
the user had changed bus and highway routes along that road.

(closes #8613)
(helps a lot #8612)
2021-08-05 14:49:14 -04:00
Bryan Housel
3b0a850400 If undo'd back to the base graph, don't show head issues as user issues 2021-08-05 12:47:52 -04:00
Bryan Housel
9f58f1fb5c Improve code for focusing a validation issue on a relation
The "center" of the issue might be a spot of map that doesn't contain the relation.
This code chooses a piece of the relation that has been downloaded and focuses on that.
2021-08-05 12:47:40 -04:00
Bryan Housel
0085c41876 Store whether a result is provisional before filtering it
Filtering returns a new array, which was clobbering the "provisional" flag.
This was causing provisionally results to not be reprocessed later,
which meant that certain "outdated_tags" results would not be in the baseCache.
(cache of issues _before_ user edits).
2021-08-02 17:15:25 -04:00
Milos Brzakovic
c6df2a0a6c Set development version number 2021-07-23 16:30:56 +02:00
Milos Brzakovic
33a012e007 v2.20.0 2021-07-23 15:53:43 +02:00
Milos Brzakovic
b135da504d oci v5.1 + get package version for file_fetcher 2021-07-08 20:05:29 +02:00
Milos Brzakovic (E-Search)
3f9fee0c05 Merge branch 'develop' into validation_queryparams_conflict_resolve 2021-07-06 19:07:07 +02:00
Milos Brzakovic (E-Search)
d2036996e3 Merge conflicts resolved 2021-07-05 10:26:44 +02:00
Bryan Housel
ba016762ca Remove unnecessary context argument 2021-07-02 10:32:45 -04:00
Bryan Housel
bfb36d572d If locationSet is missing include, default to worldwide include
https://github.com/openstreetmap/iD/pull/8305#discussion_r662344647
2021-07-02 10:03:44 -04:00
Bryan Housel
42f286b064 Switch to osm-community-index v4.0.0 2021-04-30 15:57:15 -04:00
Bryan Housel
25bf950458 Upgrade to osm-community-index (oci) v4
The main differences here is:
- oci now supports default strings and exports a "resolveStrings" function
- this makes linkifying any urls embedded in descriptions a bit more complicated
  because urls and descriptions might need resolution, we can't use iD's normal
  t() function to do the token replacement like before
2021-04-29 17:53:53 -04:00
Bryan Housel
9537911b68 Add guard code in locationsAt, for testing entities with invalid loc 2021-03-23 14:24:01 -04:00
Bryan Housel
1f6a2121c4 Move all of NSI into a service, rewrite matcher code 2021-03-03 12:04:37 -05:00
Quincy Morgan
9423f61adf Improve some variable names in core/localizer 2021-02-23 11:50:42 -05:00
Quincy Morgan
13ddeecfa7 Fix code tests for #8276 for real this time
Add utilFetchJson to get around some quirks of d3.json and use it for coreFileFetcher
Load real general English locale strings at the beginning of code tests
2021-02-23 11:50:00 -05:00
Quincy Morgan
d0754a9256 Trim whitespace from localized string ids 2021-02-15 11:09:26 -05:00
Quincy Morgan
6f66032237 Fix issue with replacing number tokens in strings when toLocaleString is unavailable, such as when running tests (re: #8276) 2021-02-15 10:59:44 -05:00
Bryan Housel
76943351ca Better handling of headGraph, separate head and base queues
This involves a few things to make the validator less weird
- _headGraph shouldn't be allowed to change while validation is happening..
- So we don't allow that to happen anymore, and keep track of _headPromise and _headIsCurrent
- If head graph falls behind, kick off another validation to catch it up
- Separate head and base work queues, so we aren't waiting for the base entities to validate
  before providing feedback to the user about what they are editing
  (the base queue can get quite large around metropolitan areas)
2021-02-12 18:07:36 -05:00
Bryan Housel
f87c2d9357 Allow validators to return provisional results, revalidate after delay
Also add a ton of commments to validator.js
2021-01-27 10:38:48 -05:00
Bryan Housel
11201eb822 Rewrite the validator in ES6/Promises, several improvements here:
- implements a validation work queue, jobs are run during browser idle callbacks
- when merging base entities, don't run validations 2x on both base and head graphs (this was wasteful)
- keep track of resolved issues in a separate set (it's not a simple compare of base/head anymore)
  this happens after validation queue is empty and avoids race conditions and inaccurate resolved counts
2021-01-25 12:50:11 -05:00
Bryan Housel
74d28257c4 Fix teh misspellings 2021-01-18 19:48:35 -05:00
Bryan Housel
a38a93c073 Actually assign the locationSetID properties on the given objects
(should have been in 868db8819)
2021-01-18 13:41:46 -05:00
Bryan Housel
d3fb8c60f9 Upgrade validations outdated_tags, suspicious_names to NSI v5 2021-01-13 13:46:00 -05:00
Bryan Housel
2d8c90786f coreLocation tests, documentation 2021-01-11 13:01:30 -05:00
Bryan Housel
868db8819f Have mergeLocationSets work on Objects, add locationSetID property
This means less work for the other parts of the code,
now they don't need to chain that extra step after the promise.
2021-01-09 10:34:58 -05:00
Bryan Housel
271e1c2e19 Use locationManager to filter fields/presets/defaults 2021-01-08 16:06:57 -05:00
Bryan Housel
ab85590eb4 Pre-resolve the world locationSet 2021-01-08 14:00:49 -05:00
Bryan Housel
0ad7de0f10 Move the location index and resolver into a global coreLocations 2021-01-08 11:29:51 -05:00
Bryan Housel
9eb6f8781f Update presetIndex to resolve and index locationSets
Added a deferred work queue to do this with requestIdleCallback in the background
2021-01-06 16:26:12 -05:00