mirror of
https://github.com/lingble/chatwoot.git
synced 2026-03-20 03:52:43 +00:00
Webpush gem throws errors such as `WebPush::ExpiredSubscription`, `WebPush::InvalidSubscription`, `WebPush::Unauthorized`. We handled only ExpiredSubscription. If the SDK threw any other errors, it would pause sending the notification to all other devices for that user. This change would update the logic to remove the expired subscription and handle the rest of the errors gracefully. Fixes https://linear.app/chatwoot/issue/CW-3399/webpushinvalidsubscription-host-fcmgoogleapiscom-nethttpnotfound-404
19 lines
385 B
Ruby
19 lines
385 B
Ruby
# frozen_string_literal: true
|
|
|
|
FactoryBot.define do
|
|
factory :notification_subscription do
|
|
user
|
|
identifier { 'test' }
|
|
subscription_type { 'browser_push' }
|
|
subscription_attributes { { endpoint: 'test', auth: 'test' } }
|
|
|
|
trait :browser_push do
|
|
subscription_type { 'browser_push' }
|
|
end
|
|
|
|
trait :fcm do
|
|
subscription_type { 'fcm' }
|
|
end
|
|
end
|
|
end
|