[openstreetmap/openstreetmap-website] Unable to delete some messages (Issue #6167)

Tom Hughes notifications at github.com
Fri Jul 4 12:57:01 UTC 2025


tomhughes left a comment (openstreetmap/openstreetmap-website#6167)

Actually your hypothesis is, indirectly, correct as the title is causing the model to fail validation:

```
open-street-map(dev)> m=Message.find(381011)
  Message Load (1.2ms)  SELECT "messages".* FROM "messages" WHERE "messages"."id" = 381011 LIMIT 1 /*application='OpenStreetMap'*/
=> 
#<Message:0x00007fce30ec2bc8
...
open-street-map(dev)> m.valid?
=> false
open-street-map(dev)> m.errors
=> #<ActiveModel::Errors [#<ActiveModel::Error attribute=title, type=contains invalid characters, options={}>]>
```

Which means that any attempt to save it, such as after updating the visibility, will fail.

The code bug is that `messages#destroy` doesn't do anything sensible on error.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6167#issuecomment-3036183139
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/6167/3036183139 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250704/5312038b/attachment-0001.htm>


More information about the rails-dev mailing list