]> git.openstreetmap.org Git - rails.git/commit
Use Noticed to deliver notifications on GPX import failure
authorPablo Brasero <pablo@pablobm.com>
Thu, 19 Mar 2026 15:23:43 +0000 (15:23 +0000)
committerPablo Brasero <pablo@pablobm.com>
Thu, 23 Apr 2026 13:34:31 +0000 (14:34 +0100)
commit6138e37a8d21b362c7f420afb49d503e1b1eb040
treeadaa73923d5113558bf52d6682de8261ed44c25f
parente257b8e8709bde8cfa4364280e27407ae8f8df63
Use Noticed to deliver notifications on GPX import failure

The previous code relied on `#deliver` (alias for `#deliver_now`) to
immediately deliver the email so that the trace could be deleted. To
work around this, we pass the details of the trace instead of the trace
record, which won't be available by the time the notifications are
ultimately delivered.

This means the trace is not there to be the `record`, so we are not
passing one. Since we can't get the recipient from the non-existing
record, we give the recipient explicitly to `#deliver_later`.

Additionally, the mailer method now needs to receive the recipient
directly, instead of extracting it from the trace record.
app/jobs/trace_importer_job.rb
app/mailers/user_mailer.rb
app/notifiers/gpx_import_failure_notifier.rb [new file with mode: 0644]
test/jobs/trace_importer_job_test.rb
test/mailers/previews/user_mailer_preview.rb
test/mailers/user_mailer_test.rb