Commit 930bd9c
committed
fix(WebSocketPolyfill): run onopen callback on initialization
After a long offline period (>70 seconds), y-websocket's internal
watchdog closes the WebSocketPolyfill instance because no messages have
been received.
After going back online, y-websocket creates a new WebSocketPolyfill
instance to reconnect. In the new instance, syncService.open() is
called — but it returns early because the HTTP session is still alive.
This results in `wsconnected` staying false, which means that new steps
never get pushed to the server.
The fix is to run onopen callback explicitly in WebSocketPolyfill's
constructor.
Signed-off-by: Jonas <jonas@freesources.org>1 parent 21deb81 commit 930bd9c
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
0 commit comments