openstreetmap/iD — pull request #2178 by bhousel (2014-03-31 03:22:25+00:00)
Title: Using disconnect on a closed way can break areas.

When disconnecting one area from another, the areas can get broken if you happen to pick the node that closes the area. This is because the disconnect action permits disconnecting the head from the tail of a closed way.

Go here:
http://localhost:8000/#background=Bing&id=n477662641&map=18.95/-74.66497/40.63322

And try disconnecting this node:
![screenshot 2014-03-30 22 44 54](https://cloud.githubusercontent.com/assets/38784/2563562/4546f0a4-b882-11e3-8116-57d452e57238.png)

This totally ruins the area! So this pull request changes the disconnect action so that it won't disconnect a the points that close a way.

It does this by:
* if the node is used multiple times, only return it once in the replacements array (added _.uniq)
* when performing the replacements, use replaceNode (which will replace both head and tail) instead of updateNode (which replaces only one node at specified index)