Does SDK always emit ConnectionState.Fail after Reconnecting?

While following this topic Clarification on connection-change behavior with fail state and failover reason, I noticed that after receiving ConnectionState.Reconnecting, it seems that the SDK always sends ConnectionState.Fail shortly afterward.

Could you please confirm if this is a guaranteed behavior?

We’re currently using Zoom Video Web SDK v2.1.0.

Thank you!

Hey @anhtv

Thanks for your feedback.

Could you please confirm if this is a guaranteed behavior?

As I mentioned in the topic you referred:

  • ConnectionState.Fail: This is a terminal state—reconnection failed.
  • ConnectionState.Reconnecting: If reconnection succeeds, a subsequent ConnectionState.Connected event will be emitted.

ConnectionState.Fail is only returned when reconnection fails. If the network condition is poor and there is still no network during the reconnection attempt, it will result in a failed reconnection, triggering ConnectionState.Fail.

Thanks
Vic

Hi @vic.yang ,
Sorry to trouble you again, and thank you for your previous support.

We have a few more questions regarding the SDK’s connection behavior:

  1. Since the SDK automatically attempts to reconnect after emitting ConnectionState.Reconnecting, is it correct that the app only needs to handle Connected and Fail (e.g., trigger manual rejoin only after receiving Fail)?

  2. If the app calls join() manually during this reconnecting state, will the SDK cancel its internal reconnect attempt?

  3. If the SDK has almost finished reconnecting internally, but the app calls join() just before it emits Connected:
    – Will it result in join() failure?
    – If so, will ConnectionState.Connected still be emitted afterward?

Thanks in advance for your clarification!

Hi @anhtv

is it correct that the app only needs to handle Connected and Fail (e.g., trigger manual rejoin only after receiving Fail )?

Yes.

However, we recommend displaying a ‘reconnecting’ prompt to the user when ConnectionState.Reconnecting is received, because during this period, audio and video functionalities are unavailable.

If the app calls join() manually during this reconnecting state, will the SDK cancel its internal reconnect attempt?

No

If the SDK has almost finished reconnecting internally, but the app calls join() just before it emits Connected:

– Will it result in join() failure?

Yes. It will return a rejected promise with ExceptionCode.CLIENT_DUPLICATED_JOIN and the reason ‘duplicated operation’.

– If so, will ConnectionState.Connected still be emitted afterward?

Yes.

In short, when the connection-change event indicates ConnectionState.Reconnecting, you should not call the join method again, as it may lead to unexpected exceptions.

Thanks
Vic

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