"MessageCommunication.ProvideCurrentStateRequest" returns (sometimes) 0 cameras after Milestone XProtect Servers restart

Hello,

we use “MessageCommunication.ProvideCurrentStateRequest” for getting available cameras. There are usually all servers and all available cameras in “ProvideCurrentStateResponse” (we can see array of “ItemState” for all cameras/servers in “Data” property). But sometimes only 1 “ItemState” come in “Data” array after Milestone servers are refreshed. There is only “ItemState” for Management server. No cameras or other servers. It doesn’t happen for every servers restart.

Please is it a bug or intended behavior (Cameras are not initialized yet)? How could we know that provided current state is valid? Is there any way how to find out difference between removed cameras and not initialized cameras?

Thanks for reply

We speculate here at Milestone Support that there might be a interim period where ProvideCurrentStateRequest would return as if there is no configuration. We will try to investigate.

We are thinking that the request should return an error rather than an empty configuration without cameras if the Event Server does not yet have loaded a configuration.

For now we are thinking that you maybe could treat the response with no cameras as a special case where you retry the request.

We have a new solution for this as the ProvideCurrentStateRequest is not entirely reliable. We would suggest looking into the Events and State WebSocket API instead, see further here https://doc.developer.milestonesys.com/mipvmsapi/api/events-ws/v1/

Do note this is only available for 2023R3 and onwards.