# 푸시 알림에 제3자 브로커가 사용되나요?

**URL:** https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004
**Category:** Support
**Created:** [2월 1, 2021, 5:00오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004 "2021-02-01T17:00:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Nycticorax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nycticorax/32/207948_2.png) [@Nycticorax](https://meta.discourse.org/u/Nycticorax)
#### Post date: [2월 1, 2021, 5:00오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/1 "2021-02-01T17:00:53Z")

</div>

@featheredtoast님, 안녕하세요. 저도 이 부분에 대해 궁금합니다. 데스크톱 웹 푸시 알림은 GCM, FCM, APNs 같은 제3자 브로커를 사용하지 않고, 대신 알림 메시지가 Redis와 같은 것으로 연결된 자체 엔드포인트에서 발생한다는 말씀이신가요? 그리고 모바일 푸시 알림만 그런 제3자 브로커를 사용한다는 뜻인가요?

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [2월 1, 2021, 6:45오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/2 "2021-02-01T18:45:14Z")

</div>

간단히 말하면, 아니요. 푸시 알림은 브라우저 자체의 통합 기능을 통해 제공되므로 제3자 브로커는 개입되지 않습니다.

기술적으로 보면, 여러분의 디바이스에 메시지를 전달하는 역할을 담당하는 서버(어딘가에 존재하며, 여러분의 Discourse 서버가 아닙니다)가 있습니다. 저희 구현 방식은 VAPID를 구현한 모든 브라우저에서 지원됩니다([Sending VAPID identified WebPush Notifications via Mozilla’s Push Service | Mozilla Services](https://blog.mozilla.org/services/2016/08/23/sending-vapid-identified-webpush-notifications-via-mozillas-push-service/)). 실제로 데이터를 여러분의 디바이스로 푸시하는 서버는 브라우저 벤더의 VAPID 서버입니다.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [3월 25, 2021, 12:14오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/3 "2021-03-25T12:14:37Z")

</div>

다시 한번 같은 내용을 물어보는 것 같아 죄송합니다. 검색을 통해 이곳에 오게 되었는데, 이 문제가 관련이 있는지 확실하지 않습니다.

저희 `/logs`에 다음과 같은 오류가 가득 차 있습니다:

`Failed to send push notification : host: fcm.googleapis.com, #<Net::HTTPForbidden 403 Forbidden readbody=true> body: the key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure you are using the correct sender ID and server Key from the Firebase console.`

> **Backtrace**
>
> ```plaintext
> webpush-1.1.0/lib/webpush/request.rb:175:in `verify_response'
> 
> webpush-1.1.0/lib/webpush/request.rb:34:in `perform'
> 
> webpush-1.1.0/lib/webpush.rb:44:in `payload_send'
> 
> /var/www/discourse/app/services/push_notification_pusher.rb:79:in `send_notification'
> 
> /var/www/discourse/app/services/push_notification_pusher.rb:25:in `block in push'
> 
> activerecord-6.0.3.3/lib/active_record/relation/delegation.rb:87:in `each'
> 
> activerecord-6.0.3.3/lib/active_record/relation/delegation.rb:87:in `each'
> 
> /var/www/discourse/app/services/push_notification_pusher.rb:23:in `push'
> 
> /var/www/discourse/app/jobs/regular/send_push_notification.rb:7:in `execute'
> 
> /var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
> 
> rails_multisite-2.5.0/lib/rails_multisite/connection_management.rb:76:in `with_connection'
> 
> /var/www/discourse/app/jobs/base.rb:221:in `block in perform'
> 
> /var/www/discourse/app/jobs/base.rb:217:in `each'
> 
> /var/www/discourse/app/jobs/base.rb:217:in `perform'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:196:in `execute_job'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
> 
> sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
> 
> /var/www/discourse/lib/sidekiq/pausable.rb:138:in `call'
> 
> sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
> 
> sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:163:in `block in process'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/job_retry.rb:111:in `local'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq.rb:38:in `block in <module:Sidekiq>'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:257:in `stats'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/job_logger.rb:13:in `call'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/job_retry.rb:78:in `global'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/logger.rb:10:in `with'
> 
> sidekiq-6.1.2/lib/sidekiq/job_logger.rb:33:in `prepare'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:123:in `dispatch'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:162:in `process'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:78:in `process_one'
> 
> sidekiq-6.1.2/lib/sidekiq/processor.rb:68:in `run'
> 
> sidekiq-6.1.2/lib/sidekiq/util.rb:15:in `watchdog'
> 
> sidekiq-6.1.2/lib/sidekiq/util.rb:24:in `block in safe_thread'
> 
> ```

이러한 오류가 수천 건 발생하고 있습니다. 이건… 정상적인 건가요?

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [3월 25, 2021, 9:45오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/4 "2021-03-25T21:45:25Z")

</div>

버그인 것 같습니다. 발신자 ID가 일치하지 않으면 해당 클라이언트가 자동으로 구독을 취소해야 하는데, FCM에서 오류 메시지를 감지하는 부분에 어딘가 버그가 있는 것 같습니다.

확실히 클라이언트 측 문제가 아니지만, 네, 이거는 존재해선 안 되는 노이즈(잡음)입니다.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [3월 25, 2021, 10:04오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/5 "2021-03-25T22:04:53Z")

</div>

`Webpush::InvalidSubscription`와 `Webpush::Unauthorized` 예외는 구독을 해제하는 방식으로 처리해야 할 것 같습니다. 푸시 알림의 [오류 처리](https://github.com/discourse/discourse/blob/eb25d3a954d03792bce29cda01420807842df25f/app/services/push_notification_pusher.rb#L102-L118)를 마지막으로 업데이트했을 당시에는 이 예외들이 존재하지 않았던 것 같습니다.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [3월 26, 2021, 10:10오전 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/6 "2021-03-26T10:10:24Z")

</div>

앞서 언급했듯이, 우리는 이 문제를 수천 건씩 보고받고 있습니다:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/8/780dbce349c19d9ddc33dd7561c63ee6b24f76c0.png)

이 게시물이 주제에 맞게 유지되기를 원하신다면, 이전에 [여기](https://meta.discourse.org/t/push-notification-errors-in-logs/171164/3)에서 이 문제를 보고한 적이 있습니다. 통합/삭제 등 필요한 조치를 취해 주십시오.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [8월 4, 2022, 12:51오후 UTC](https://meta.discourse.org/t/do-push-notifications-use-3rd-party-brokers/178004/7 "2022-08-04T12:51:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
