Openstreetmap-website: Error 500 on showing note with no comments

Created on 17 Feb 2019  路  6Comments  路  Source: openstreetmap/openstreetmap-website

Observed behavior

Displaying a note with no comments yields an error 500.

How to reproduce

Display this note: https://www.openstreetmap.org/note/940980
the note via the API: https://api.openstreetmap.org/api/0.6/notes/940980

Expected behavior

  1. The OSM Api should reject creating a note without an initial comment
  2. Either all current notes with no comments are deleted from DB or displaying a note with no comment should not yield an error 500

Most helpful comment

I guess a good approach would be to treat it the same as map data and GPS traces a deleted user contributed.

All 6 comments

I don't think that's true is it. I thought @Firefishy established that the cause was that the creator of the note had been deleted because they were a spammer?

So the immediate cause might be that there are no (visible) comments, but the conclusion that the API allows creation of a note without a comment is not - the only bug here is the exception when a note has no visible comments.

That might as well be, I can't see whether it is invisible or never existed, I only reported what I saw. Anyway, if the (only) comment was deleted, then error 500 would still not be appropriate.

Sorry I assumed it was you that had been discussing it with @Firefishy on IRC last night but I now see that it wasn't and in fact that was a different note.

The cause is essentially the same - the user that opened this note deleted their account causing their note comments to be hidden.

This wasn't a spam note though, which raises the question of whether we should in fact hide comments from deleted users or not, or whether we should just treat them as anonymous,

I guess a good approach would be to treat it the same as map data and GPS traces a deleted user contributed.

Was this page helpful?
0 / 5 - 0 ratings