fix(edge): alertAdmins 스로틀 판정 반전 — 30분 창 첫 알림이 삼켜지던 버그 - #180
Merged
Conversation
rate_limit_hit 은 true=허용(이번 소모가 창의 1회)/false=초과를 반환하는데 (rateLimited() 의 `data === false` 판정과 같은 방향), edge_alert 는 `limited === true → return` 으로 반대로 읽고 있었다. 결과 — 각 30분 창의 **첫** 관리자 알림이 삼켜지고 2회째부터는 스로틀 없이 무제한 발송. "알림 없음 = 사고 없음" 판단을 무너뜨리는 관측성 결함이다(v9.0 설계문서 교차 검토 중 발견, 2026-08-08). - 판정을 `allowed === false → skip` 으로 교정, 변수명도 규약대로 allowed - edge_alert_test.ts 신설 — 허용/초과/리미터 오류(fail-open) 3케이스로 반전 회귀 방지 (fcm_test.ts 와 같은 방식, denocheck 잡이 실행) - 영향 함수: verify-post-photo · enroll-pet-identity · send-phone-code · send-push (머지 시 deploy-functions.yml 이 재배포) Co-Authored-By: Claude Fable 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.
무엇을
_shared/edge_alert.ts의 스로틀 판정이rate_limit_hit반환 규약과 반대로 붙어 있었다.true= 허용(이번 소모가 창의 1회),false= 초과 —_shared/auth.tsrateLimited()의data === false판정과 같은 방향.limited === true → return→ 각 30분 창의 첫 관리자 알림이 삼켜지고, 2회째부터는 스로틀 없이 무제한 발송."알림이 안 왔으니 사고 없음"이라는 운영 판단을 무너뜨리는 관측성 결함이다. v9.0 설계문서 세트 교차 검토 중 발견(문서 3종이 일관되게 적은 "30분 1회" 의도와 코드가 어긋난 사례).
어떻게
allowed === false → skip으로 교정(변수명도allowed로), fail-open(리미터 오류 시 발송)은 그대로.edge_alert_test.ts신설 — 허용/초과/리미터 오류 3케이스. 기존fcm_test.ts와 같은 방식이라db-tests.ymldenocheck 잡이 자동 실행한다.검증
deno test3/3 통과,deno check오류 0건(래칫 상한 ≤1 유지).deploy-functions.yml게이트 통과 후 자동 재배포된다.참고
🤖 Generated with Claude Code