Repository navigation
feat(browser): add built-in Chrome bulk update setting and API - #38
Merged
Merged
Conversation
4 of 5 tasks
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.
변경 요약
server/browser/chrome/install.ts,resolve.ts,launcher.ts): 공식 Chrome for Testing 엔드포인트에서 최신 Stable 버전을 조회하고, 다운로드 URL 도메인·경로 검증(validateChromeForTestingDownloadUrl), 임시 디렉터리 설치 및 바이너리 검증(verifyBinary) 후<dataDir>/tools/chrome/<version>로 반영하며,preferChromeForTesting설정으로 구버전 시스템 Chrome 대신 최신 다운로드 바이너리를 우선 선택할 수 있도록 했습니다.server/browser/chrome/profile.ts,updater.ts):omb-profile.json중 로컬(backend === "local") 프로필의 Chrome 버전을 스캔해 현재 바이너리와 불일치하는 프로필 수·요구 버전을 집계하고,ChromeUpdater에서설치 → 바이너리 검증 → 설정 반영 → 런처 reset/prepare → 유휴 세션 일괄 종료 → (활성 세션 0일 때만) 구버전 정리순서로 안전하게 일괄 업데이트를 수행합니다.server/routes/status.ts,server/host/browser.ts,server/index.ts):GET /api/browser-chrome/status(cache-control: no-store,?refresh=1강제 새로고침 지원)POST /api/browser-chrome/update(관리자 인증 필수403, JSON Content-Type 검증415, 업데이트 불가/충돌 시409, 비동기 시작202 Accepted)src/components/BrowserSettingsRows.tsx,PlacePages.tsx,src/locales/en.json,ko.json): 설정의 브라우저 섹션에 현재 버전, 프로필 버전 불일치 경고(N profile(s) require Chrome <version>), 다운로드 진행률(50 / 100 MB), 업데이트 불가 사유 비활성화 상태 및일괄 업데이트(Update all)버튼을 추가했습니다.이유
158.0.8127.36)에서 열린 뒤 하위 버전 Chrome(예:157.0.8103.51)으로 실행될 경우 OpenMyBot의 다운그레이드 거부(downgradeRefusal)가 발생하며, 사용자가 설정 화면에서 내장 브라우저를 최신 버전으로 일괄 업데이트하고 유휴 세션에 즉시 반영할 방법이 없었습니다.OMB_CHROME_PATH,OMB_BROWSER_LEGACY_SHELL,OMB_RESOURCES_PATH) 업데이트 비활성화 및 사유 안내verifyBinary) 실패 시 설정(preferChromeForTesting) 변경 및 런처 리셋 없이 즉시 중단pruneOld) 보류테스트 방법
Before / After 증적
Before (수정 전)
Chrome 158.0.8127.36으로 마지막 실행된 상태에서 내장 브라우저가Chrome 157.0.8103.51을 잡으면 다운그레이드 거부(downgradeRefusal)로 브라우저 실행이 실패함.GET /api/browser-chrome/status,POST /api/browser-chrome/update,BrowserChromeUpdateRow)이 존재하지 않아 수동으로 Chrome을 교체하거나 프로필을 정리해야 했음.After (수정 후)
vitest run대상 32개 테스트 파일 32 passed (32), 216 passed | 3 todo (219)updater.test.ts: 로컬 프로필 스캔 및 불일치 카운트,preferDownloaded플랜 선택, 다운로드 URL 검증,chromeUpdatability, TTL 캐시 +forceCheck,install → verify → prefer → reset → prepare → closeIdle → prune전체 순서, 활성 세션 잔존 시pruneOld보류,verifyBinary실패 시 설정 무변경 검증 통과status-browser-chrome.test.ts: 비관리자403, 상태 조회200+cache-control: no-store+refresh=1, 비-JSON415, 업데이트 불가409, 비동기 업데이트 시작202검증 통과BrowserSettingsRows.test.ts: 프로필 불일치 경고 표시,Update all클릭 시POST /api/browser-chrome/update호출 및 진행률(50 / 100 MB) 표시,updatable: false시 버튼 비활성화 검증 통과pnpm run lint(oxlint --deny-warnings .): 0 errors, 0 warningspnpm run typecheck && pnpm run build: exit code 0