kmpoppe / noteSolver

JOSM Plugin: Automatically resolve notes after uploading a changeset.
https://wiki.openstreetmap.org/wiki/User:Kmpoppe/Plugins#noteSolver
GNU General Public License v3.0
12 stars 3 forks source link

JOSM trac #22891 #27

Closed kmpoppe closed 1 year ago

kmpoppe commented 1 year ago

https://josm.openstreetmap.de/ticket/22891

Original Request

What steps will reproduce the problem?

  1. I "marked" a comment and wanted to upload changes afterwards.
  2. When I click on the upload button it appears that the plugin is not working and should be updated, deactivated or kept.
  3. No matter which of these I click, the crash report comes up.
=== STACK TRACE ===

Thread: AWT-EventQueue-1 (62) of JOSM (development version)
java.lang.NullPointerException: Cannot invoke "org.openstreetmap.josm.data.notes.NoteComment.toString()" because the return value of "org.openstreetmap.josm.data.notes.Note.getFirstComment()" is null
    at org.openstreetmap.josm.plugins.notesolver.NoteText.noteShortText(NoteText.java:8)
    at org.openstreetmap.josm.plugins.notesolver.NoteSolverPlugin.mainMenuEntries(NoteSolverPlugin.java:393)
    at org.openstreetmap.josm.plugins.notesolver.NoteSolverPlugin.updateMenu(NoteSolverPlugin.java:353)
    at org.openstreetmap.josm.plugins.notesolver.NoteSolverPlugin$5.actionPerformed(NoteSolverPlugin.java:170)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6391)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Analysis

The note in question was https://www.openstreetmap.org/note/3574079, which using the API shows, that the initial comment was deleted, thus no comments are left and the NULL Exception above is explained.

For further reading on why that happened, the JOSM request details that.

mcliquid commented 1 year ago

I've found another one. I use https://ent8r.github.io/NotesReview/ to find OSM Notes in my area. There is this one: image

OSM-Link: https://www.openstreetmap.org/note/3543539

I've opened the area in JOSM: image

After solving the Note I've clicked on the note and clicked "mark" and then the upload button in JOSM. Result: image

When I open the Note in OSM there's a error 500: image

mcliquid commented 1 year ago

Update: I've checked another 15 notes around the Bodensee (Swiss landside) and got also an error 500. Examples in Switzerland: https://www.openstreetmap.org/note/3477797 --> error 500 https://www.openstreetmap.org/note/3543524 --> 500 https://www.openstreetmap.org/note/3519275 --> 500 https://www.openstreetmap.org/note/3554085 --> 500 https://www.openstreetmap.org/note/3555335 --> 500 Example in Austrias: https://www.openstreetmap.org/note/3593110 --> works fine https://www.openstreetmap.org/note/3477772 --> works https://www.openstreetmap.org/note/3530076 --> works https://www.openstreetmap.org/note/3477694 --> works

There seems to be an OSM Notes issue in Switzerland?

kmpoppe commented 1 year ago

So, skyper said in his comment on trac that there are multiple discussions around this. All the Notes you mentioned above are http 500 because the first commenter (which is seen by the website as the opener) deleted their account. That makes the Notes unusable, as long as there's not another comment on them. Funnily enough, NotesReview seems to have saved the first comment from somewhere which is why you see the note there but can't open the website. Also a good example is this note, because the first comment is gone, but the second comment is now showing the user "habi" to be the originator, even though they were merely the last comment.

So, I think all the notes you found on the Swiss side of the Bodensee came from one user that is now gone for good.

kmpoppe commented 1 year ago

@mcliquid Please download the Beta from https://github.com/kmpoppe/noteSolver/releases/tag/0.5.3-beta, put it in your local plugins folder and check if the problem is solved.

Thanks! K

mcliquid commented 1 year ago

Note URL before: https://www.openstreetmap.org/note/3543539 image

Then I closed the issue in JOSM (no error šŸ‘ ) image

But then the Note is mine: image

Thanks for solving this really fast! As it's not your issue anymore, how to get rid of the "deleted" comments in OSM? This one would be another one: https://www.openstreetmap.org/note/3556413