fix(bonjour): classify ciao IPv4 changed assertion

Classify ciao's IPv4 address changed assertion spelling in the Bonjour plugin and cover the exact upstream message.
This commit is contained in:
Vincent Koc
2026-04-27 20:56:43 -07:00
committed by GitHub
parent f6c0aa256e
commit 9a19d8b8ea
2 changed files with 12 additions and 1 deletions

View File

@@ -21,6 +21,17 @@ describe("bonjour-ciao", () => {
});
});
it("classifies ciao interface assertions using changed wording", () => {
expect(
classifyCiaoUnhandledRejection(
new Error("Reached illegal state! IPv4 address changed from undefined to defined!"),
),
).toEqual({
kind: "interface-assertion",
formatted: "Reached illegal state! IPv4 address changed from undefined to defined!",
});
});
it("classifies ciao netmask assertions separately from side effects", () => {
expect(
classifyCiaoUnhandledRejection(

View File

@@ -2,7 +2,7 @@ import { formatBonjourError } from "./errors.js";
const CIAO_CANCELLATION_MESSAGE_RE = /^CIAO (?:ANNOUNCEMENT|PROBING) CANCELLED\b/u;
const CIAO_INTERFACE_ASSERTION_MESSAGE_RE =
/REACHED ILLEGAL STATE!?\s+IPV4 ADDRESS CHANGE FROM (?:DEFINED TO UNDEFINED|UNDEFINED TO DEFINED)!?/u;
/REACHED ILLEGAL STATE!?\s+IPV4 ADDRESS CHANGED? FROM (?:DEFINED TO UNDEFINED|UNDEFINED TO DEFINED)!?/u;
const CIAO_NETMASK_ASSERTION_MESSAGE_RE =
/IP ADDRESS VERSION MUST MATCH\.\s+NETMASK CANNOT HAVE A VERSION DIFFERENT FROM THE ADDRESS!?/u;
// Restricted sandboxes (NemoClaw, Docker-in-Docker, k3s with locked-down policy)