mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
use uuid v7
This commit is contained in:
1 parent
d3c92cecfa
commit
e22a3d9ef3
4 files changed
+5
-5
No files matched your search
@@ -66,7 +66,7 @@ class WebhookSettingsController < ApplicationController
|
|||||||
|
|
||||||
SendTestWebhookRequestJob.perform_async(
|
SendTestWebhookRequestJob.perform_async(
|
||||||
'submitter_id' => submitter.id,
|
'submitter_id' => submitter.id,
|
||||||
'event_uuid' => SecureRandom.uuid,
|
'event_uuid' => SecureRandom.uuid_v7,
|
||||||
'webhook_url_id' => @webhook_url.id
|
'webhook_url_id' => @webhook_url.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class ProcessSubmitterCompletionJob
|
|||||||
|
|
||||||
WebhookUrls.for_account_id(submitter.account_id, %w[form.completed submission.completed]).each do |webhook|
|
WebhookUrls.for_account_id(submitter.account_id, %w[form.completed submission.completed]).each do |webhook|
|
||||||
if webhook.events.include?('form.completed')
|
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,
|
SendFormCompletedWebhookRequestJob.perform_async('submitter_id' => submitter.id,
|
||||||
'event_uuid' => event_uuids['form.completed'],
|
'event_uuid' => event_uuids['form.completed'],
|
||||||
@@ -109,7 +109,7 @@ class ProcessSubmitterCompletionJob
|
|||||||
|
|
||||||
next unless webhook.events.include?('submission.completed') && is_last
|
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,
|
SendSubmissionCompletedWebhookRequestJob.perform_async('submission_id' => submitter.submission_id,
|
||||||
'event_uuid' => event_uuids['submission.completed'],
|
'event_uuid' => event_uuids['submission.completed'],
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
# index_webhook_events_on_webhook_url_id_and_id (webhook_url_id,id)
|
# index_webhook_events_on_webhook_url_id_and_id (webhook_url_id,id)
|
||||||
#
|
#
|
||||||
class WebhookEvent < ApplicationRecord
|
class WebhookEvent < ApplicationRecord
|
||||||
attribute :uuid, :string, default: -> { SecureRandom.uuid }
|
attribute :uuid, :string, default: -> { SecureRandom.uuid_v7 }
|
||||||
|
|
||||||
belongs_to :webhook_url, optional: true
|
belongs_to :webhook_url, optional: true
|
||||||
belongs_to :account, optional: true
|
belongs_to :account, optional: true
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ module WebhookUrls
|
|||||||
webhook_urls = for_account_id(account_id, event_type)
|
webhook_urls = for_account_id(account_id, event_type)
|
||||||
|
|
||||||
account_records.each do |record|
|
account_records.each do |record|
|
||||||
event_uuid = SecureRandom.uuid
|
event_uuid = SecureRandom.uuid_v7
|
||||||
|
|
||||||
webhook_urls.each do |webhook_url|
|
webhook_urls.each do |webhook_url|
|
||||||
next unless webhook_url.events.include?(event_type)
|
next unless webhook_url.events.include?(event_type)
|
||||||
|
|||||||
Reference in new issue
Block a user