From b46c77bff0612527bdfc7540ea31ec258bd002b1 Mon Sep 17 00:00:00 2001 From: luar123 <49960470+luar123@users.noreply.github.com> Date: Tue, 28 Jul 2026 17:20:41 +0200 Subject: [PATCH] fix: Avoid running resolveDefinition in parallel (#32662) --- lib/model/device.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/model/device.ts b/lib/model/device.ts index a590035f5..906bfcac4 100644 --- a/lib/model/device.ts +++ b/lib/model/device.ts @@ -18,6 +18,7 @@ export default class Device { public zh: zh.Device; public definition?: zhc.Definition; private _definitionModelID?: string; + #isResolvingDefinition?: boolean; get ieeeAddr(): string { return this.zh.ieeeAddr; @@ -64,9 +65,11 @@ export default class Device { } async resolveDefinition(ignoreCache = false): Promise { - if (this.interviewed && (!this.definition || this._definitionModelID !== this.zh.modelID || ignoreCache)) { + if (this.interviewed && !this.#isResolvingDefinition && (!this.definition || this._definitionModelID !== this.zh.modelID || ignoreCache)) { + this.#isResolvingDefinition = true; this.definition = await zhc.findByDevice(this.zh, true); this._definitionModelID = this.zh.modelID; + this.#isResolvingDefinition = false; } }