Commit Graph

31 Commits

Author SHA1 Message Date
Bryan Housel
ca02cf4b96 Graph#revert accept id instead of entity ref
trivial test cases (revert across create/update/delete) all pass
2015-04-28 11:22:46 -04:00
Bryan Housel
6b18066dd6 Graph#revert (see #537) 2015-04-26 01:07:48 -04:00
Bryan Housel
848d19a116 Don't cache array lengths
see https://github.com/openstreetmap/iD/pull/2489#discussion_r22489237
2015-03-09 18:02:05 -04:00
Bryan Housel
cb0e8ab66c Initial support for Multi Fetch GET
It will also be much faster to fetch the remote entities in batches
rather than one at a time through LoadEntity.

One bonus/hazard with Multi Fetch GET is that it will get deleted entities
with `visible=false`, rather than returning a HTTP Status Code 410 (Gone).

This will be the only way that we can really do proper undeletion
(Incrementing the current version by 1 is not guaranteed to work.  And
if a way is moved, fetching way/full will tell us whether the childnodes
are part of the way, but not necessarily whether they exist or not.)

We must be careful never to merge deleted entities into the real graph.
e.g, a deleted node will not have a 'loc' attribute, so code that assumes
every node must have a `loc` will be broken.

So because deleted entities are very special, the output from `loadMultiple`
should only be used for conflict resolution for now.
2015-03-03 20:54:09 -05:00
Bryan Housel
d9f204cf45 Remove Graph#freeze 2015-01-07 11:52:17 -05:00
Bryan Housel
4088f2e70a properly load changed entities into altgraph and produce diffs. 2014-12-05 11:15:45 -05:00
Bryan Housel
1c3d198b96 add force option for rebase to overwrite existing entities
related: openstreetmap/iD#2467
2014-12-04 19:50:32 -05:00
Bryan Housel
c6ca68ce80 create feature _cache to store matches per entity
also remove old commented code
2014-11-08 00:19:36 -05:00
Bryan Housel
2f6004fcfa performance tuning work-in-progress
* store entity's matched features in a graph transient
* replace fn calls to get commonly used _keys and _hidden arrays
* replace lodash calls with faster for loops (in some places)
* always pass graph/resolver as a param
2014-11-05 00:27:14 -05:00
Bryan Housel
dcc9812986 prevent most operations on things connected to hidden features.. 2014-10-28 21:37:02 -04:00
John Firebaugh
089924ac38 Remove unused variable 2014-01-06 16:26:55 -08:00
John Firebaugh
4bf21cbc8a Restore deleted nodes that are discovered to have extant parents
This bug has existed since 1.0!

Fixes #2085
2014-01-06 16:23:15 -08:00
John Firebaugh
492fc88aa4 Make the Graph#rebase argument an array 2013-10-31 16:24:31 -07:00
John Firebaugh
ffdeef398d Rewrite tree logic
The main problem with the existing logic was that it
did not update the extents of relations when previously incomplete members were loaded.

It was also overly stateful; the various queues and flags
are no longer required.

Fixes #1928.
Fixes #1540.
2013-10-28 16:57:18 -07:00
John Firebaugh
1e78ee5c87 Stricter jshint 2013-10-24 16:08:48 -07:00
John Firebaugh
2efafa087b Deduplicate entities in serialized history
Fixes #1403
2013-08-14 16:49:53 -07:00
John Firebaugh
6d506ec6d4 Fix mutation of childNodes array 2013-06-18 14:21:07 -07:00
John Firebaugh
6045ffcfbe Comment why _childNodes needn't be updated 2013-05-18 09:20:58 -07:00
John Firebaugh
293bb23876 Graph#rebase must invalidate transients 2013-05-18 09:20:57 -07:00
John Firebaugh
c50c3121d8 Make Graph#entity strict
Use Graph#hasEntity for the previous behavior.
2013-04-24 09:27:37 -07:00
John Firebaugh
781f540b3c Add diagnostic for common sentry errors 2013-04-23 11:29:00 -07:00
John Firebaugh
20833c139c Avoid _.bind
Seeing some weird object retention behavior with it.
2013-04-21 16:41:59 -07:00
Tom MacWright
7925662079 Avoid writing undefined properties in JSON localStorage 2013-03-08 14:07:02 -05:00
Tom MacWright
71a4c5a383 Fix jshint errors - plz do not use unnecessary magic 2013-03-04 12:08:54 -05:00
Ansis Brammanis
147fce1f49 Merge branch 'tree-intersects'
Conflicts:
	js/id/behavior/lasso.js
2013-02-15 13:40:01 -05:00
John Firebaugh
5e66307500 Fix incorrect parentWays after reloading a split way
When recalculating parent ways/relations during rebase, a
graph should not add modified or deleted entities as parents.
Such entities will already be correctly marked as parents or
not.

Graph had the correct behavior for deleted entities, but not for
modified entities. This had the effect that if you split a way
that was partially off screen, and then panned so that the way was
re-retrieved, Graph#rebase would mistakenly add back the original
way as a parent of all the nodes that were split into the new
section, making them appear as shared.

Fixes #751.
2013-02-13 16:03:23 -08:00
Ansis Brammanis
529b570c89 Merge remote-tracking branch 'systemed/master' into tree-intersects 2013-02-13 13:31:11 -05:00
Ansis Brammanis
a21b973a41 Fix saving deletions to storage, add tests 2013-02-13 12:42:51 -05:00
Ansis Brammanis
9c65e58cc1 Tree handles entities with missing children 2013-02-13 10:23:30 -05:00
Tom MacWright
61d7ec45b5 Banish function ( style 2013-02-12 16:35:47 -05:00
John Firebaugh
843baa11c0 graph -> core
This matches how it's described in ARCHITECTURE.md.
2013-02-09 15:18:54 -08:00