fix: 영수증 공유 버튼 연타 시 미지원 안내가 뜨던 문제 - #495
Conversation
공유 시트가 열린 상태에서 navigator.share() 를 다시 호출하면 InvalidStateError/NotAllowedError 가 나는데, AbortError 가 아니라는 이유로 전부 unsupported 로 떨어져 엉뚱한 안내가 노출됐다. - 중복 호출 에러를 'busy' 로 분류해 조용히 무시 - handleShareLink 에 ref 기반 연타 가드 추가 (리렌더 전 두 번째 클릭 차단) - 공유 진행 중에는 링크 공유 버튼 비활성화 — 스토리 공유와 동일한 처리
isSharing 이 state 로만 관리돼 리렌더 전 두 번째 클릭을 막지 못했다. 링크 공유와 동일하게 ref 로 즉시 차단하고, 중복 호출은 'busy' 로 반환해 안내 없이 무시한다.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 58 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
작업 요약
작업 세부 내용
공유 시트가 이미 열린 상태에서
navigator.share()를 다시 호출하면InvalidStateError(Safari 는NotAllowedError) 가 발생합니다. 기존 코드는AbortError가 아니면 전부unsupported로 떨어뜨려, 실제로는 공유를 지원하는 환경인데도 미지원 안내가 노출됐습니다.1. 중복 호출 에러를 별도 분류
busy를 추가해 연타로 인한 중복 호출을 미지원과 구분합니다. 브라우저마다 에러 이름이 달라InvalidStateError/NotAllowedError를 함께 처리했습니다.2. 호출부 연타 가드
state가 아닌ref로 막았습니다 — state 는 리렌더 후에야 버튼에 반영되는데 연타는 그 사이에 들어오기 때문입니다. 버튼 비활성화 표시용으로 state 도 함께 둡니다.3. 스토리 공유도 동일 처리
useInstagramStoryShare의isSharing역시 state 로만 관리돼 같은 취약점이 있었습니다. 링크 공유와 동일하게 ref 가드를 넣고, 중복 호출은busy로 반환해 안내 없이 무시합니다.연관 이슈
closes #481