Browse Source

Fixed Switch Control widget hanging on one-way persistent RPC

pull/15711/head
Maksym Tsymbarov 2 days ago
parent
commit
4efc667cfb
  1. 3
      ui-ngx/src/app/core/api/widget-subscription.ts

3
ui-ngx/src/app/core/api/widget-subscription.ts

@ -871,7 +871,8 @@ export class WidgetSubscription implements IWidgetSubscription {
return timer(initialTimeout, pollingInterval).pipe(
switchMap(() => this.ctx.deviceService.getPersistedRpc(response.rpcId, true)),
filter(persistentRespons =>
persistentRespons.status !== RpcStatus.DELIVERED && persistentRespons.status !== RpcStatus.QUEUED),
(oneWayElseTwoWay && persistentRespons.status === RpcStatus.DELIVERED) ||
(persistentRespons.status !== RpcStatus.DELIVERED && persistentRespons.status !== RpcStatus.QUEUED)),
switchMap(persistentResponse => {
if ([RpcStatus.TIMEOUT, RpcStatus.EXPIRED].includes(persistentResponse.status)) {
return throwError(() => ({status: 504}));

Loading…
Cancel
Save