fix(slack): optional 스코프 누락을 전송 불능과 구분해 알린다 (#478) - #482
Open
parkjs101 wants to merge 1 commit into
Open
Conversation
A Slack app installed before v2.17.10 lacks channels:join, chat:write.public, team:read and mpim:read. The startup check found them and announced "missing 4 scope(s)" at WARN — while the socket was connected and the bot was answering. The operator could not tell that from a transport that cannot run, and reinstalled the app to find out (#478). The status object has held missingRequired and missingCapabilities separately all along; only the reporting flattened them. describeSlackScopeGap concatenated both arrays and then picked ONE severity word for the result, so the two failures were never distinguishable at the surface an operator reads: a single missing chat:write promoted every optional scope to "the transport needs", and an optional-only gap borrowed WARN from a break that was not happening. The count spanned both, which is why it could not be acted on. So it returns one line per severity now, and each logs at its own level. The optional line says messaging is unaffected, because that was the operator's actual question. The manifest itself needs no change: it has carried all four scopes since v2.17.10 (channels:join, chat:write.public) and v2.14.0 (team:read, mpim:read). Slack fixes a grant at install time, so an app created from an older manifest keeps the gap until it is reinstalled — a real state to report, just not a broken one. Fixes #478.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
parkjs101
marked this pull request as ready for review
August 26, 2026 08:42
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.
무엇이 문제였나
v2.17.10 이전에 설치된 Slack 앱은
channels:join,chat:write.public,team:read,mpim:read4개가 빠져 있다. 기동 시 점검이 이걸 찾아내고missing 4 scope(s)를 WARN 으로 알렸는데, 그 시점에 소켓은 연결돼 있었고 봇은 정상 응답 중이었다. 제보자는 이게 "고장" 인지 "기능 일부 없음" 인지 판단할 근거가 없어서, 확인을 위해 앱을 재설치했다 (#478).원인
판정 데이터는 처음부터 나뉘어 있었다 —
missingRequired와missingCapabilities는 별개 배열이다. 납작해진 건 보고 단계뿐이다.두 배열을 이어붙인 뒤 severity 를 전체에 하나만 골랐다. 그래서 두 실패가 운영자가 읽는 표면에서 구분되지 않았다.
chat:write하나만 빠져도 optional 스코프까지 전부the transport needs로 승격됐다수정
severity 당 한 줄씩 반환하고, 각자 자기 레벨로 로깅한다.
optional 줄에
messaging is unaffected를 명시한 건 그게 제보자의 실제 질문이었기 때문이다.매니페스트는 건드리지 않았다. 이슈의 세 번째 제안(4개를 매니페스트에 추가)은 이미 반영돼 있다 —
channels:join/chat:write.public은 v2.17.10,team:read/mpim:read는 v2.14.0 부터 들어 있다. Slack 은 설치 시점에 grant 를 고정하므로 구버전 매니페스트로 만든 앱은 재설치 전까지 이 상태가 유지된다. 보고할 가치가 있는 상태이되, 고장은 아니다.범위
로그 문구와 레벨만 바뀐다. 스코프 필수/선택 분류(
REQUIRED_SLACK_BOT_SCOPES/SLACK_CAPABILITY_SCOPES),/api/health의slackScopes응답,SlackScopeStatus필드는 그대로다. 소비자는bot.ts한 곳뿐이었다.테스트 (2건 신규)
기존 5건은 새 시그니처로 갱신했다.
증거
npx tsx --test tests/unit/slack-scope-drift.test.ts— 10 passed / 0 failednpx tsc --noEmitexit 0describeSlackScopeGap잔여 참조 0건structure/verify-counts.sh443/443 일치미검증으로 남긴 것: 전체 스위트(
npm test)와npm run build는 아직 돌리지 않았다. draft 인 이유다.