From e22a3d9ef3df0ec16077b8859bc9a58bd4d29c1b Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Tue, 27 Oct 2026 11:24:42 +0200 Subject: [PATCH] use uuid v7 --- app/controllers/webhook_settings_controller.rb | 2 +- app/jobs/process_submitter_completion_job.rb | 4 ++-- app/models/webhook_event.rb | 2 +- lib/webhook_urls.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/webhook_settings_controller.rb b/app/controllers/webhook_settings_controller.rb index 77fa22bff..6b6cf9140 100644 --- a/app/controllers/webhook_settings_controller.rb +++ b/app/controllers/webhook_settings_controller.rb @@ -66,7 +66,7 @@ class WebhookSettingsController < ApplicationController SendTestWebhookRequestJob.perform_async( 'submitter_id' => submitter.id, - 'event_uuid' => SecureRandom.uuid, + 'event_uuid' => SecureRandom.uuid_v7, 'webhook_url_id' => @webhook_url.id ) diff --git a/app/jobs/process_submitter_completion_job.rb b/app/jobs/process_submitter_completion_job.rb index 1dc1da132..da4f5b03a 100644 --- a/app/jobs/process_submitter_completion_job.rb +++ b/app/jobs/process_submitter_completion_job.rb @@ -100,7 +100,7 @@ class ProcessSubmitterCompletionJob WebhookUrls.for_account_id(submitter.account_id, %w[form.completed submission.completed]).each do |webhook| if webhook.events.include?('form.completed') - event_uuids['form.completed'] ||= SecureRandom.uuid + event_uuids['form.completed'] ||= SecureRandom.uuid_v7 SendFormCompletedWebhookRequestJob.perform_async('submitter_id' => submitter.id, 'event_uuid' => event_uuids['form.completed'], @@ -109,7 +109,7 @@ class ProcessSubmitterCompletionJob next unless webhook.events.include?('submission.completed') && is_last - event_uuids['submission.completed'] ||= SecureRandom.uuid + event_uuids['submission.completed'] ||= SecureRandom.uuid_v7 SendSubmissionCompletedWebhookRequestJob.perform_async('submission_id' => submitter.submission_id, 'event_uuid' => event_uuids['submission.completed'], diff --git a/app/models/webhook_event.rb b/app/models/webhook_event.rb index 885a16b19..d5bdb6246 100644 --- a/app/models/webhook_event.rb +++ b/app/models/webhook_event.rb @@ -22,7 +22,7 @@ # index_webhook_events_on_webhook_url_id_and_id (webhook_url_id,id) # class WebhookEvent < ApplicationRecord - attribute :uuid, :string, default: -> { SecureRandom.uuid } + attribute :uuid, :string, default: -> { SecureRandom.uuid_v7 } belongs_to :webhook_url, optional: true belongs_to :account, optional: true diff --git a/lib/webhook_urls.rb b/lib/webhook_urls.rb index 242c274cf..5544499a6 100644 --- a/lib/webhook_urls.rb +++ b/lib/webhook_urls.rb @@ -54,7 +54,7 @@ module WebhookUrls webhook_urls = for_account_id(account_id, event_type) account_records.each do |record| - event_uuid = SecureRandom.uuid + event_uuid = SecureRandom.uuid_v7 webhook_urls.each do |webhook_url| next unless webhook_url.events.include?(event_type)