Repository navigation
fix(bridge): stop re-running detail discovery for every device on restart (1.8.75) - #118
Merged
Merged
Conversation
… restart Detail discovery attempts reset on every browser context start, so each Bridge restart re-opened a SmartThings page for every device (~319 visits for 239 devices), keeping Bridge at 30-40% CPU for about three hours. Controls are restored from the persisted inventory, so devices whose detail controls are already complete no longer need a visit. Camera image devices and incomplete devices are still inspected as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Devices that stay incomplete after maxAttempts visits were visited twice again on every Bridge restart (80 devices in the 2026-11-10 measurement). Record them in /data/detail-discovery.json (device id, sha256 of the name, time) and skip them for seven days or until the name changes. Camera image devices are never recorded, and preempted visits do not count. A missing or corrupt file only means devices are visited again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
문제
Bridge가 시작될 때마다 상세 조회(detail discovery)가 모든 기기를 다시 엽니다. 시도 기록이 브라우저 컨텍스트 시작 때마다 초기화되고, 첫 시도는 무조건 조회하기 때문입니다. 실측(2026-11-10): Bridge 시작 후 약 3시간 동안 15
20초마다 Chrome 렌더러가 새로 뜨고 Bridge CPU가 2448%였습니다. 조회가 끝나자 2~3%로 내려갔습니다. 기기 239대 중 159대는 1회, 80대는 2회 조회했습니다.변경
maxAttempts)를 다 써도 완성되지 않은 기기는/data/detail-discovery.json에 기록합니다. 기록 내용은 기기 id, 이름의 sha256, 시각입니다. 기록된 기기는 재시작 후에도 7일 동안, 또는 이름이 바뀔 때까지 다시 조회하지 않습니다.예상 효과 (추정)
재시작 후 조회 횟수가 약 319회에서 카메라 몇 회로 줄어듭니다. 단 이 버전으로 처음 시작할 때는 아직 소진 기록이 없으므로, 미완성 기기를 한 번 더 2회씩 조회합니다.
배포
사용자 요청에 따라 다음 Bridge 릴리스에 함께 넣습니다. 이 PR을 main에 병합하면 Release 워크플로가 돌기 때문에 지금은 병합하지 않습니다. 버전·CHANGELOG는 릴리스할 때 올립니다.
검증
tar테스트(tests/local-addon-update-helper.test.ts)로, CI에서는 통과합니다.npm run typecheck통과.🤖 Generated with Claude Code