Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reset aborted flags when starting link reliability or route health check #7022

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/zwave-js/src/lib/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6518,6 +6518,7 @@ protocol version: ${this.protocolVersion}`;
* {@link checkRouteHealth} will be resolved with the results obtained so far.
*/
public abortHealthCheck(): void {
if (!this._healthCheckInProgress) return;
this._healthCheckAborted = true;
this._abortHealthCheckPromise?.resolve();
}
Expand Down Expand Up @@ -6550,6 +6551,7 @@ protocol version: ${this.protocolVersion}`;

try {
this._healthCheckInProgress = true;
this._healthCheckAborted = false;
this._abortHealthCheckPromise = createDeferredPromise();

return await this.checkLifelineHealthInternal(rounds, onProgress);
Expand Down Expand Up @@ -6875,6 +6877,7 @@ ${formatLifelineHealthCheckSummary(summary)}`,

try {
this._healthCheckInProgress = true;
this._healthCheckAborted = false;
this._abortHealthCheckPromise = createDeferredPromise();

return await this.checkRouteHealthInternal(
Expand Down Expand Up @@ -7178,6 +7181,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`,
* When it is, the promise returned by {@link checkLinkReliability} will be resolved with the results obtained so far.
*/
public abortLinkReliabilityCheck(): void {
if (!this._linkReliabilityCheckInProgress) return;
this._linkReliabilityCheckAborted = true;
this._abortLinkReliabilityCheckPromise?.resolve();
}
Expand All @@ -7204,6 +7208,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`,

try {
this._linkReliabilityCheckInProgress = true;
this._linkReliabilityCheckAborted = false;
this._abortLinkReliabilityCheckPromise = createDeferredPromise();

switch (options.mode) {
Expand Down