Commit Graph

107 Commits

Author SHA1 Message Date
Martin Raifer
918126e5f8 revalidate entities with changed relation memberships 2025-02-18 13:19:32 +01:00
Kyℓe Hensel
f513ccd03d enable intellisense for the main classes (#10618) 2025-02-17 11:35:50 +01:00
andrewpmk
a7038955ca Revalidate disconnected_way and impossible_oneway errors on change (#8911) 2025-02-15 18:45:32 +01:00
Martin Raifer
5d2c5e63a5 lint, add to changelog 2022-04-19 11:47:43 +02:00
Milos Brzakovic (E-Search)
2b42adc06d validator reset deferred promise cleanup 2022-03-08 10:48:27 +01:00
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
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
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 (E-Search)
3f9fee0c05 Merge branch 'develop' into validation_queryparams_conflict_resolve 2021-07-06 19:07:07 +02: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
abde015288 Allow validation severity to be overridden with url params 2020-12-10 15:40:58 -05:00
Quincy Morgan
70619d3634 Reset validator whenever reseting the history (close #8108) 2020-10-21 19:30:18 -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
a58abe3c6f Move localStorage interface from a property of coreContext to a corePreferences function 2020-04-01 11:00:48 -07:00
Quincy Morgan
c2d82eb9ce Don't require translations in coreValidator 2020-03-02 13:49:51 -08:00
Quincy Morgan
f0fe025c55 Ensure unshared issues aren't displayed during multiselection even if just one of the features has issues 2020-02-26 18:49:03 -08:00
Quincy Morgan
9d31d444d0 Show only issues shared by all features on multiselection 2020-02-04 12:09:54 -05:00
Bryan Housel
eb0c297bbd Rewrite the issue gathering code to not use for..of 2020-02-03 17:25:34 -05:00
Quincy Morgan
b4bc5305a1 Enable the issues section for multiple selected features (close #7324) 2020-02-03 12:17:14 -05:00
Bryan Housel
b949cc6bb6 Sometimes the issue cache has junk in it.
I got this to happen after some issues had been detected on the live map,
then starting the intro walkthrough (which replaces the graph).

No time now to dig into the root cause, but this might make the problem go
away so the tutorial doesn't get too weird.
2020-01-27 17:38:29 -05:00
Quincy Morgan
9345ec7a82 Update reload unsquare issues function name 2020-01-07 11:41:04 -05:00
Quincy Morgan
24c72b64d1 Load issue fixes dynamically instead of cacheing them (close #7037) 2019-11-13 14:35:01 -05:00
Quincy Morgan
56f31adcf1 Always sort the entity issues list deterministically
Don't skip validations just because a different validation produced issues
2019-10-12 17:01:03 +02:00
Quincy Morgan
7251a2ab90 Make "edited issues" mean "issues the user created" instead of "issues for features edited by the user"
Only include issues created by the user in the "warnings" changeset tags
Include counts of issues resolved by the user in the changeset tags (close #6459)
Don't include "fixme" issue counts in "warnings" changeset tags since they're not created by the user (close #6658)
Don't cache crossing ways issues at the rule level
2019-10-04 16:50:44 +02:00
Quincy Morgan
6a515576f1 Add an "Extract this point" quick fix for points-as-vertices validation warnings (re: #6319) 2019-10-01 18:21:03 +02:00
Quincy Morgan
525916da74 Recategorize tags_suggests_area validation rule into mismatched_geometry rule
Warn about points tagged as vertices and vertices tagged as points (close #6319)
2019-09-26 10:56:30 +02:00
Quincy Morgan
d5da5a601c Fix error upon revalidating after changing unsquare building threshold (close #6690) 2019-07-26 14:11:15 -04:00
Quincy Morgan
1ed73b6531 Convert validation rules to validate against a specific graph, not always the current graph (re: #6459) 2019-06-06 16:27:31 -04:00
Bryan Housel
511f8ecc82 Allow user to adjust the threshold for the unsquare building warning 2019-05-18 15:44:29 -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
Quincy Morgan
b4b91dcb9e Revalidate the related entities of deleted entities when revalidating (close #6345) 2019-05-10 15:46:04 -04:00
Quincy Morgan
7a6949aa2e Account for the width of open panes when centering the map on issues 2019-05-10 11:33:59 -04:00
Quincy Morgan
1bbd496dfe When selecting an issue in the Issues pane, highlight the issue after selecting the feature
Use the same behavior when selecting an issue in the commit sidebar as in the issues pane
2019-05-10 10:18:46 -04:00
Quincy Morgan
f264cc47f0 Don't flag almost junctions when endpoint is building or parking entrance
Include issues for disabled rules in entity issues
2019-05-09 14:38:19 -04:00
Quincy Morgan
1d797b8fc6 Validate connected ways when validating a way to avoid stale connectivity issues (close #6335) 2019-05-08 14:56:49 -04:00