[openstreetmap/openstreetmap-website] Use Noticed for notifications on GPX imports (PR #6939)

Andy Allan notifications at github.com
Wed Mar 25 17:09:26 UTC 2026


gravitystorm left a comment (openstreetmap/openstreetmap-website#6939)

> Thoughts?

My initial reaction is that this is the classic ActiveJob model reference problem. Because the job stores a reference to the object, and then looks up the object attributes at some later time, it's not guaranteed that the object still exists when the job runs. This is that same problem on maximum scale, since it affects 100% of the jobs, instead of just a small enough percentage that everyone sweeps the problem under the carpet.

My usual approach for similar circumstances is to serialise the required attributes into the job. This means the job runs without needing to load the object. So something like:

```diff
- GpxImportFailureNotifier.with(:record => trace, :error => e.to_s).deliver_later
+ GpxImportFailureNotifier.with(:error => e.to_s, :trace_name => trace.name, :trace_description => trace.description, :trace_tags => ...etc...).deliver_later
```

However, I don't know if noticed is particularly happy without having a record to associate with. https://github.com/excid3/noticed?tab=readme-ov-file#handling-deleted-records only covers the case where you want to avoid sending notifications for deleted objects, but that's the opposite of what we want here.

This also makes me think about how we would handle this with on-site notifications. What if I upload 10 traces and come back to the website next weekend? How will the system know what to write in the site notifications?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6939?email_source=notifications&email_token=AAK2OLILSAQJZ3J3IM77YST4SQHENA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJSHAZDQMBXGM3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS2XA4S7MNXW23LFNZ2F633QMVXF6Y3MNFRWW#issuecomment-4128280736
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6939/c4128280736 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260325/6a664e0d/attachment-0001.htm>


More information about the rails-dev mailing list