Repository navigation
fix(push): 웹 알림 탭 링크 — send-push 가 웹 토큰에 webpush.fcm_options.link 를 싣는다 - #217
Merged
Merged
Conversation
웹(app.pawmate.kr) 서비스워커는 알림을 누르면 서버가 실은 링크로 보내도록
만들어져 있었는데, send-push 는 그 블록을 한 번도 싣지 않았다(web-port 설계는
전제했지만 빠져 있었다). 그래서 웹 알림을 누르면 어떤 알림이든 갈 곳 없이
첫 화면이나 열린 탭만 보였다.
- _shared/push_link.ts: 알림의 resource 로 웹 링크를 만든다.
post → ${WEB_APP_URL}/p/<id>, user → /u/<id>. 채팅(웹은 앱 전용)·공지·보안·
초대처럼 웹 화면이 없는 알림은 null. 기준 주소가 비었거나 https 가 아니면
null — FCM 은 https 절대 주소만 받고, 잘못된 링크로 발송이 거절되면 웹 알림이
통째로 사라지기 때문이다.
- send-push: 웹 토큰(platform='web')에만 webpush.fcm_options.link 를 붙인다.
네이티브 메시지는 바뀌지 않는다.
- 테스트 7건(push_link_test.ts), docs/supabase-api.md 의 send-push·시크릿 표 갱신
(WEB_APP_URL 행이 빠져 있던 것도 함께).
짝 PR(pmdart): 서비스워커가 SDK 를 초기화하지 않아 백그라운드 웹 푸시가 표시되지
않던 문제와, 링크를 열린 탭에서 따라가는 처리.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇이 문제였나
웹(
app.pawmate.kr) 서비스워커는 알림을 누르면 서버가 실은 링크로 보내게 돼 있는데,send-push는 그 블록(webpush.fcm_options.link)을 한 번도 싣지 않았다. web-port 설계(API 명세서 §8.3)는 이 블록을 전제했지만 빠져 있었다. 그래서 웹 알림을 누르면 어떤 알림이든 갈 곳이 없었다(2026-10-26 설계문서 대조 중 발견).바꾼 것
_shared/push_link.ts— 알림의 resource 로 웹 링크를 만든다.post→${WEB_APP_URL}/p/<id>,user→${WEB_APP_URL}/u/<id>send-push— 웹 토큰(platform='web')에만webpush.fcm_options.link를 붙인다. iOS·Android 메시지는 그대로다.docs/supabase-api.md— send-push 설명과 시크릿 표(빠져 있던WEB_APP_URL행 포함)운영
WEB_APP_URL은https://app.pawmate.kr로 이미 설정돼 있다(시크릿 해시 대조). 새 시크릿은 필요 없다.시험
deno test supabase/functions/_shared/push_link_test.ts— 7건 통과(게시글·사용자 링크, 웹 화면 없는 종류, 끝/정리, 하위 경로, http·빈 값 거부, uuid 아닌 id 거부)deno check supabase/functions/*/index.ts— 오류 1건, 수정 전과 같음(기존_shared/auth.ts:77, 래칫 ≤1 안)짝 PR
seizeh/pmdart#327 — 서비스워커가 SDK 를 초기화하지 않아 백그라운드 웹 푸시가 표시되지 않던 문제, 링크를 열린 탭에서 따라가는 처리. 두 PR 은 순서와 무관하게 머지해도 서로 깨지지 않는다(링크만 먼저 실리면 지금 SW 는 무시, SW 만 먼저 바뀌면 링크 없는 알림처럼 동작).
배포 뒤 확인
웹(데스크톱 크롬)에서 로그인해 알림을 허용한 계정으로, 탭을 다른 탭 뒤로 보낸 상태에서 다른 계정이 그 사람의 게시글에 지원하거나 팔로우하면 시스템 알림이 뜨고, 누르면 같은 탭에서 그 게시글·프로필이 열려야 한다.
🤖 Generated with Claude Code