Fix an EvenHub compatibility issue when a text container is updated with only an ID and not a container name

This commit is contained in:
James Babcock committed 2026-08-19 12:40:57 -07:00
1 parent 90603b5aa4
commit 5abbe2a405
1 file changed
+6 -1
+6 -1
View File
@@ -703,8 +703,13 @@ export class EvenHubSession implements EvenHubMicClient, EvenHubImuClient {
private textUpgrade(data: Record<string, unknown>): boolean {
const id = readNumber(data, "containerID", -1);
// containerID is the identity; containerName is optional in the wild (e.g.
// level-even-g2 omits it). Match by id, enforcing the name only when the app
// actually supplies a non-empty one. (updateImage already matches by id.)
const name = readString(data, "containerName", "");
const container = this.page?.containers.find((c) => c.kind === "text" && c.id === id && c.name === name);
const container = this.page?.containers.find(
(c) => c.kind === "text" && c.id === id && (name === "" || c.name === name),
);
if (!container || container.kind !== "text") return false;
const content = readString(data, "content", "");
const offset = readOptionalNumber(data, "contentOffset");