Skip to content

fix(bridge): keep refresh controls and card type across periodic resync (1.8.74) - #117

Merged
1bobby-git merged 2 commits into
mainfrom
fix/bridge-resync-controls-type-1.8.74
Nov 10, 2026
Merged

1bobby-git merged 2 commits into
mainfrom
fix/bridge-resync-controls-type-1.8.74

Conversation

@1bobby-git

Copy link
Copy Markdown
Owner

문제

1.8.73에서 통합의 실행 중 삭제는 막았지만, Bridge의 30분 주기 재조정(state_sync_watchdog → StateReconciliationCoordinator) 때마다 인벤토리가 흔들리는 원인은 남아 있었습니다.

  1. #applyAdvancedDeviceSnapshot(authoritative)이 advanced:refresh:* 버튼 컨트롤을 만듭니다. 곧이어 비동기 buildAdvancedCommandCatalog → #applyAdvancedCommandCatalog가 advanced:로 시작하는 컨트롤을 전부 지우고 스위치 토글만 다시 넣습니다. 그래서 새로고침 버튼이 재조정마다 사라집니다. 실제 설치본에서는 새로고침 버튼 엔티티 138개가 재조정 때 지워졌다가 다음 재조정에서야 복원되는 것을 확인했습니다.
  2. Advanced 행의 deviceType·type·deviceTypeId에는 통신 방식 값(테스트 데이터 기준 ZIGBEE, 운영에서는 OCF로 추정)이 들어옵니다. 이 값이 기기 카드의 deviceTypeData.type(washer 등)을 덮어썼습니다. 운영에서는 재조정 직후 건조기·세탁기·식기세척기 전원 binary_sensor가 읽기 전용 가전이 아닌 것으로 판정돼 지워졌습니다. 실제 Advanced 행 값을 직접 보지는 않았습니다.

수정

  • 카탈로그 반영은 advanced:refresh:*를 남기고, 자신이 만드는 스위치 토글만 교체합니다.
  • 기기 종류: deviceTypeName(의미 있는 종류)은 지금처럼 덮어씁니다. deviceType·type·deviceTypeId는 종류가 비어 있을 때만 채웁니다. presentation은 기존 값이 있으면 유지합니다.

테스트

  • 새 테스트 2개(device-store.test.ts): 카탈로그 반영 후에도 새로고침 버튼이 남는지, Advanced 행의 deviceType: "OCF"가 기기 카드의 washer를 덮어쓰지 않는지 확인합니다. 둘 다 수정 전 실패(OCF 재현), 수정 후 통과.
  • 기존 merges same-origin advanced device metadata(deviceTypeName이 종류를 덮어씀)는 유지됩니다.
  • vitest 1944 통과. Windows tar 관련 2건만 로컬 실패합니다(CI 통과 이력 있음).
  • 버전 1.8.74입니다. Bridge 앱 업데이트가 필요하고, 통합 코드는 바뀌지 않았습니다.

남은 것

재조정 사이에 기기 4개가 약 40분간 인벤토리에서 빠졌던 현상은 Bridge 코드에서 경로를 찾지 못했습니다. 이 PR로는 해결되지 않습니다.

🤖 Generated with Claude Code

1bobby-git and others added 2 commits November 10, 2026 11:15
…nc (1.8.74)

- Applying the Advanced command catalog dropped every advanced: control
  and re-added only switch toggles, so the refresh buttons the resync
  snapshot had just rebuilt vanished after every reconciliation. The
  catalog now replaces only the toggles it owns.
- An Advanced row's deviceType/type/deviceTypeId (often OCF, ZIGBEE)
  overwrote the device card's type (washer, dryer), flipping read-only
  appliance classification. Those fields now only fill a missing type;
  deviceTypeName still refines it. An existing presentation is kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@1bobby-git
1bobby-git merged commit dbbf5bd into main Nov 10, 2026
7 checks passed
@1bobby-git
1bobby-git deleted the fix/bridge-resync-controls-type-1.8.74 branch November 10, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant