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

Pablo Brasero notifications at github.com
Tue Apr 7 06:03:22 UTC 2026


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

I had another look. There's a third way to do this which I now prefer. The following list supersedes the one above:
1. (New) Don't link a record. Noticed seems to work well with this and feels the most natural to me.
	- `record_type` and `record_id` are `nil`/`NULL`.
	- This requires that we pass a recipient explicitly to `#deliver_later`.
2. Have the `record` be the user instead of the trace.
	- I think this is a bit contrived.
3. Use [ephemeral notifications](https://github.com/excid3/noticed/pull/382):
	- With these, the initial delivery must be synchronous (no `deliver_later`). Note that the individual notifications (emails, etc) are still async/queued.
	- This also requires passing the recipient explicitly (to `#deliver` in this case).
	- When it comes to on-site notifications, these would definitely require a separate model. That might be a good idea anyway; the proof of concept I put together last time (https://github.com/openstreetmap/openstreetmap-website/compare/master...pablobm:notifications) had plenty room for improvement.
	- I have experimented with this option at https://github.com/openstreetmap/openstreetmap-website/compare/master...pablobm:ephemeral-notifications

In common to all options, any additional arguments are stored in the `params` column, where we can put the trace data before deletion.
- One potential issue is that the `params` column can get big as `params[:error]` may store an exception backtrace.
- When rendering later (eg: on-site notifications), the data can be accessed at `params[:trace_name]` and `params[:trace_description]` to describe the notification.

Of the options above, this PR now implements option 1. I have also integrated this notification into my proof of concept at https://github.com/openstreetmap/openstreetmap-website/compare/master...pablobm:notifications. This is currently deployed to my Dev Server setup, where it can be seen in action [in the dashboard](https://pablobm.apis.dev.openstreetmap.org/dashboard) of user `mapper` (password `password`):

<img width="660" height="106" alt="Proof of concept of a list of notifications, shown on the website. Two notifications are listed, one linking to a note that has received a comment, another describing a GPX import that has failed, including its name and description" src="https://github.com/user-attachments/assets/90373fb6-ceaf-43d9-a9b5-dabbd1c24233" />



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

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


More information about the rails-dev mailing list