fix: 브릿지 메시지 앱 버전 게이팅 도입 - #384
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
📝 WalkthroughWalkthrough웹뷰 브릿지 메시지 명칭을 방향별로 정리하고, 앱 버전 파싱·비교 및 최소 버전 게이트를 추가했습니다. ChangesWebView 브릿지 호환성
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant WebClient
participant WebBridge
participant AppVersion
participant BridgeGate
participant NativeApp
WebClient->>WebBridge: postMessage(message)
WebBridge->>BridgeGate: read minAppVersion
WebBridge->>AppVersion: getAppVersion()
AppVersion-->>WebBridge: current app version
WebBridge->>NativeApp: postMessage when supported
WebBridge-->>WebClient: return true or false
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/src/app/login/_components/LoginButtons.tsx (1)
73-81: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win브릿지 전송 실패 시 네이티브 로그인 대기 상태를 해제하세요.
WebBridge.postMessage는 이제boolean을 반환하지만, 현재 코드는 반환값을 무시하고 항상true를 반환합니다. 앱 버전 게이트가 요청을 차단하면nativePendingProvider가 남아 로그인 버튼이 계속 비활성화되고 웹 로그인 fallback도 실행되지 않습니다.
isSent가false이면setNativePendingProvider(null)후false를 반환하도록 수정하세요.수정 예시
setNativePendingProvider(provider); - WebBridge.postMessage({ + const isSent = WebBridge.postMessage({ type: WEBBRIDGE_MESSAGE_TYPE.WEB_REQ_SOCIAL_LOGIN, payload: { provider }, }); - return true; + if (!isSent) { + setNativePendingProvider(null); + return false; + } + return true;As per coding guidelines,
postMessage반환값을 확인하고 차단 시 pending 상태를 정리해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/app/login/_components/LoginButtons.tsx` around lines 73 - 81, Update postNativeMessage to capture the boolean returned by WebBridge.postMessage; when it is false, clear the pending provider with setNativePendingProvider(null) and return false, while preserving the existing true return for successfully sent requests.Source: Coding guidelines
🧹 Nitpick comments (1)
apps/web/src/utils/webBridge.ts (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win타입 전용 import를 분리하세요.
WebBridgeMessageT는 런타임 값으로 사용되지 않습니다. 저장소 규칙대로import type으로 분리하세요.수정 예시
-import { BRIDGE_GATE, WEBVIEW_UA_TOKEN, type WebBridgeMessageT } from '`@piki/core`'; +import { BRIDGE_GATE, WEBVIEW_UA_TOKEN } from '`@piki/core`'; +import type { WebBridgeMessageT } from '`@piki/core`';🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/utils/webBridge.ts` at line 1, Update the import in webBridge.ts to separate WebBridgeMessageT into a type-only import, while keeping BRIDGE_GATE and WEBVIEW_UA_TOKEN in the regular runtime import from `@piki/core`.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@apps/web/src/app/login/_components/LoginButtons.tsx`:
- Around line 73-81: Update postNativeMessage to capture the boolean returned by
WebBridge.postMessage; when it is false, clear the pending provider with
setNativePendingProvider(null) and return false, while preserving the existing
true return for successfully sent requests.
---
Nitpick comments:
In `@apps/web/src/utils/webBridge.ts`:
- Line 1: Update the import in webBridge.ts to separate WebBridgeMessageT into a
type-only import, while keeping BRIDGE_GATE and WEBVIEW_UA_TOKEN in the regular
runtime import from `@piki/core`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3392ab3f-eb95-4ae4-976c-c9d299e3834b
📒 Files selected for processing (15)
CLAUDE.mdapps/app/app/index.tsxapps/app/hooks/useSocialLogin.tsapps/web/src/app/layout.tsxapps/web/src/app/login/_components/LoginButtons.tsxapps/web/src/app/mypage/_components/AppVersionFooter.tsxapps/web/src/app/mypage/_utils/appVersion.tsapps/web/src/hooks/useImagePicker.tsapps/web/src/hooks/useNativeLoginResult.tsapps/web/src/utils/appVersion.tsapps/web/src/utils/webBridge.tspackages/core/src/consts/appVersion.tspackages/core/src/consts/webBridge.tspackages/core/src/index.tspackages/core/src/types/login.ts
💤 Files with no reviewable changes (1)
- apps/web/src/app/mypage/_utils/appVersion.ts
작업 요약
작업 내용
PIKI_APP/<version>토큰에서 앱 버전을 추출/비교하는 유틸(getAppVersion,isAppVersionSupported)을 서버·클라이언트 공통으로 정리BRIDGE_GATE로 정의하고,WebBridge.postMessage가 전송 전 이를 검사하도록 변경 (전송 성공 여부를boolean으로 반환)WEB_REQ_*/APP_RES_*)에 맞게 정리 (배포된 앱과의 호환을 위해 와이어 값은 유지)스크린샷
버전을 만족하지 않을 경우 토스트가 뜨는 예시
2026-07-25.7.40.36.mov
연관 이슈
closes #370
Summary by CodeRabbit
새 기능
버그 수정
문서