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

[BUG] AlarmDataCmd incorrect behaviour over TelemetrySubscriber (websockets) #19

Closed
alenas opened this issue Oct 30, 2023 · 1 comment
Closed

Comments

@alenas
Copy link

alenas commented Oct 30, 2023

I have Flutter web application. We are paying customer and I tried both PE and community version of dart client - we have this problem since version 1.0.2 till the latest.

There is one subscription to get latest device data and another to get latest alarm data.
The problems are:

  1. AlarmDataCmd kills the other EntityDataQuery (as then the other does not receive any response).
  2. AlarmDataCmd behaves incorrectly, as it creates a new websocket every 1 second or so, instead of communicating over the same open websocket (like EntityDataQuery does) - as you can see here in Developer Console:
    image

So if there is no AlarmDataQuery - then everything works fine.

sample code that I am using:

var alarmFields = <EntityKey>[ EntityKey(type: EntityKeyType.ALARM_FIELD, key: "createdTime"), EntityKey(type: EntityKeyType.ALARM_FIELD, key: "type"), EntityKey(type: EntityKeyType.ALARM_FIELD, key: "severity"), EntityKey(type: EntityKeyType.ALARM_FIELD, key: "status"), ]; var alarmQuery = AlarmDataQuery( entityFilter: DeviceTypeFilter(deviceType: "v4"), alarmFields: alarmFields, pageLink: AlarmDataPageLink( pageSize: 1000, searchPropagatedAlarms: true, timeWindow: 604800000, sortOrder: EntityDataSortOrder(key: EntityKey(type: EntityKeyType.ALARM_FIELD, key: "createdTime"), direction: EntityDataSortOrderDirection.DESC))); subscription = TelemetrySubscriber(client.getTelemetryService(), [AlarmDataCmd(cmdId: 101, query: alarmQuery)]); subscription!.alarmDataStream.listen(onData, onError: onError, onDone: onDone, cancelOnError: true); subscription!.subscribe();

@vvlladd28
Copy link
Member

@alenas Thanks for reporting the problem
This has already been fixed by a commit on master: see ed042f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants