Notification WebSocket Closing Warning Event

Category: API

Summary: A new event will be sent to Notification WebSockets before they are intentionally closed by the server. The event will be sent one minute prior to the socket closing with the topic "v2.system.socket_closing". This event is not guaranteed to be sent in all cases where the WebSocket is closed.

Context: Notification WebSockets must occasionally be disconnected by the server for maintenance purposes, and this will allow clients to proactively open a new WebSocket channel when they know their current connection will be dropped soon. This will allow clients to miss fewer events if they choose to react to the new event by opening a new WebSocket.

Impact: A new system event will be sent out occasionally. No action is required.

Date of Change: 3/27/2020

Impacted APIs: Notifications

Thanks for the update. Two questions:

  1. Do we have to subscribe for this notification?
  2. Is it safe to resubscribe/reconnect immediately when this is received?
  3. @tim.smith - how does this translate and send through the C# SDK?
  1. No, all v2.system.* topics are sent automatically
  2. Yes
  3. The NotificationHandler needs an update; the auto-subscribed v2.system topics didn't exist when the helper was created and it doesn't handle them gracefully currently. I think auto-registering classes for metadata and system topics so they trigger the NotificationReceived event without having to explicitly register for them would be a good solution. Would you expect a different pattern?

I would agree they should come standard without needing to register.

Does this apply to the Guest Chat API as well?

Yes, both guest chat and user websockets are serviced by the backend. Guest chats are currently in process of migrating to the same backend that other notifications use. This notification won't be sent on guest chat WebSockets until that migration is complete.

Ok. Is there a way to force this event to be sent for testing purposes? The context in our use case would be the guest chat.

You could write a unit test for your websocket event handler method that provides a payload for this topic.

Right. I guess the topic name v2.system.socket_closing would be enough here. Thanks.

@joel_hellman, I wanted to circle back on this; my answer isn't correct, yet. :slight_smile: Guest chats are currently in process of migrating to the same backend that other notifications use. This notification won't be sent on guest chat WebSockets until that migration is complete.

Ah, good to know. Then I have to ask, since we are in the middle of testing and releasing our new chat built on the Guest chat APIs - and relying heavily on the websocket events emitted to keep track of what's happening in the chat - do you expect any breaking changes (i.e. such changing the order the events are emitted in) as part of that migration or is it just backend stuff that would be transparent for us?
I haven't seen any announcements, so I guess it might still early, but if you have anything to share on that topic I'd love to hear about it. I'd guess we are maybe two-three weeks away from release at this point.

You won't notice the change. All of the WebSocket connections in the rest of the platform, except for guest chat, have already been migrated without notification consumers being aware of the change.

Very good, thanks.

FYI https://github.com/MyPureCloud/platform-client-sdk-dotnet/releases/tag/86.0.0

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.