fix(bonjour): suppress ciao IPv4 address-change assertion crash#42698
fix(bonjour): suppress ciao IPv4 address-change assertion crash#42698androidshu wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR suppresses a known Key changes:
Code clarity note: The second IPv4 pattern ( Confidence Score: 4/5
Last reviewed commit: ca577dd |
| "REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE", | ||
| "REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGED", |
There was a problem hiding this comment.
The second IPv4 pattern on line 11 ("REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGED") is fully subsumed by the first pattern on line 10 ("REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE"). Since the matching uses String.prototype.includes() for substring matching, any error message triggering the second pattern would already be caught by the first. This makes the second entry dead code that doesn't affect correctness but could mislead future maintainers.
Consider removing the second pattern and adding a clarifying comment:
| "REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE", | |
| "REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGED", | |
| "REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE", // covers both "change" and "changed" variants |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/infra/bonjour-ciao.ts
Line: 10-11
Comment:
The second IPv4 pattern on line 11 (`"REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGED"`) is fully subsumed by the first pattern on line 10 (`"REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE"`). Since the matching uses `String.prototype.includes()` for substring matching, any error message triggering the second pattern would already be caught by the first. This makes the second entry dead code that doesn't affect correctness but could mislead future maintainers.
Consider removing the second pattern and adding a clarifying comment:
```suggestion
"REACHED ILLEGAL STATE! IPV4 ADDRESS CHANGE", // covers both "change" and "changed" variants
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
@homebridge/ciaothrows an IPv4 transition assertion (Reached illegal state! IPv4 address changed...).ignoreCiaoCancellationRejection()to also suppress ciao IPv4 assertion variants and added focused unit tests.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Crash trace observed before fix:
Validation run:
pnpm vitest run src/infra/bonjour-ciao.test.ts src/infra/bonjour.test.ts src/infra/unhandled-rejections.test.ts # 3 files, 43 tests passedNote: repository-wide
pnpm checkcurrently fails on upstream formatting insrc/cli/daemon-cli/lifecycle.test.ts(unrelated to this PR).Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/infra/bonjour-ciao.tssrc/infra/bonjour-ciao.test.tsRisks and Mitigations