Commit 0a14a20
committed
Fix using signaling settings while being refetched
When the external signaling server returns the error "token_expired" the
signaling settings are fetched again. However, if there are further
requests and "token_expired" is returned again the previous fetch is
canceled and a new one started instead, which caused the settings to be
temporary set to "null". The signaling settings are expected to always
be an object, so setting them to "null" could cause an error if they
were used during that time (for example, during a reconnection, which
caused the signaling object to "hang" and not do any further connection
attempt).
Preventing the settings to be nullified is only half of the story,
though; "token_expired" can be thrown when trying to connect, and errors
thrown when trying to connect cause a reconnection attempt. This could
end in a reconnection loop, as each "token_expired" error would
cause another fetch of the settings, cancelling the previous fetch and
thus preventing the settings to be updated, and as the previous settings
would be still used any connection attempt would end again in another
"token_expired" error.
To solve all that now any connection attempt done after receiving a
"token_expired" error is deferred until the signaling settings were
updated.
Note that the previous signaling settings are kept to ensure that a
signaling object is always available, even if outdated. However, any
usage of the outdated signaling settings is expected to cause a
"token_expired" error to be thrown; right now that only happens during
connections, so only that code needs to wait for the settings to be
fetched again.
Signed-off-by: Daniel Calviño Sánchez <[email protected]>1 parent c7e681c commit 0a14a20
2 files changed
+39
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
144 | 158 | | |
145 | 159 | | |
146 | 160 | | |
| |||
654 | 668 | | |
655 | 669 | | |
656 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
657 | 684 | | |
658 | 685 | | |
659 | 686 | | |
| |||
1423 | 1450 | | |
1424 | 1451 | | |
1425 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
1426 | 1464 | | |
1427 | 1465 | | |
1428 | 1466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
0 commit comments