cojson-transport-ws 0.8.13 → 0.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +155 -148
- package/dist/BatchedOutgoingMessages.js +3 -3
- package/dist/BatchedOutgoingMessages.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/serialization.js.map +1 -1
- package/dist/tests/BatchedOutgoingMessages.test.js +41 -11
- package/dist/tests/BatchedOutgoingMessages.test.js.map +1 -1
- package/dist/tests/createWebSocketPeer.test.js +9 -13
- package/dist/tests/createWebSocketPeer.test.js.map +1 -1
- package/package.json +5 -9
- package/src/BatchedOutgoingMessages.ts +36 -35
- package/src/index.ts +168 -166
- package/src/serialization.ts +25 -23
- package/src/tests/BatchedOutgoingMessages.test.ts +138 -106
- package/src/tests/createWebSocketPeer.test.ts +404 -411
- package/src/types.ts +19 -20
- package/tsconfig.json +2 -2
- package/.eslintrc.cjs +0 -24
- package/.prettierrc.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,437 +1,444 @@
|
|
|
1
1
|
# cojson-transport-nodejs-ws
|
|
2
2
|
|
|
3
|
+
## 0.8.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b934fab]
|
|
8
|
+
- cojson@0.8.16
|
|
9
|
+
|
|
3
10
|
## 0.8.13
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
6
13
|
|
|
7
|
-
-
|
|
14
|
+
- e0dd006: Add the onClose handler and improve the closing operation
|
|
8
15
|
|
|
9
16
|
## 0.8.12
|
|
10
17
|
|
|
11
18
|
### Patch Changes
|
|
12
19
|
|
|
13
|
-
-
|
|
14
|
-
|
|
20
|
+
- Updated dependencies [6ed75eb]
|
|
21
|
+
- cojson@0.8.12
|
|
15
22
|
|
|
16
23
|
## 0.8.11
|
|
17
24
|
|
|
18
25
|
### Patch Changes
|
|
19
26
|
|
|
20
|
-
-
|
|
21
|
-
|
|
27
|
+
- Updated dependencies [1ed4ab5]
|
|
28
|
+
- cojson@0.8.11
|
|
22
29
|
|
|
23
30
|
## 0.8.7
|
|
24
31
|
|
|
25
32
|
### Patch Changes
|
|
26
33
|
|
|
27
|
-
-
|
|
34
|
+
- e82cf3d: Enable WebSocket batching on client peers
|
|
28
35
|
|
|
29
36
|
## 0.8.6
|
|
30
37
|
|
|
31
38
|
### Patch Changes
|
|
32
39
|
|
|
33
|
-
-
|
|
40
|
+
- 5542fdb: Added batching to the WebSocket messsages
|
|
34
41
|
|
|
35
42
|
## 0.8.5
|
|
36
43
|
|
|
37
44
|
### Patch Changes
|
|
38
45
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
46
|
+
- Updated dependencies [c3f4e6b]
|
|
47
|
+
- Updated dependencies [d9152ed]
|
|
48
|
+
- cojson@0.8.5
|
|
42
49
|
|
|
43
50
|
## 0.8.3
|
|
44
51
|
|
|
45
52
|
### Patch Changes
|
|
46
53
|
|
|
47
|
-
-
|
|
48
|
-
|
|
54
|
+
- Updated dependencies
|
|
55
|
+
- cojson@0.8.3
|
|
49
56
|
|
|
50
57
|
## 0.8.0
|
|
51
58
|
|
|
52
59
|
### Patch Changes
|
|
53
60
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
61
|
+
- Updated dependencies [6a147c2]
|
|
62
|
+
- Updated dependencies [ad40b88]
|
|
63
|
+
- cojson@0.8.0
|
|
57
64
|
|
|
58
65
|
## 0.7.35
|
|
59
66
|
|
|
60
67
|
### Patch Changes
|
|
61
68
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
69
|
+
- f350e90: Added a priority system for the sync messages
|
|
70
|
+
- Updated dependencies [35bbcd9]
|
|
71
|
+
- Updated dependencies [f350e90]
|
|
72
|
+
- cojson@0.7.35
|
|
66
73
|
|
|
67
74
|
## 0.7.34
|
|
68
75
|
|
|
69
76
|
### Patch Changes
|
|
70
77
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
78
|
+
- 406ab9b: Remove WS buffer filling log message
|
|
79
|
+
- Updated dependencies [5d91f9f]
|
|
80
|
+
- Updated dependencies [5094e6d]
|
|
81
|
+
- Updated dependencies [b09589b]
|
|
82
|
+
- Updated dependencies [2c3a40c]
|
|
83
|
+
- Updated dependencies [4e16575]
|
|
84
|
+
- Updated dependencies [ea882ab]
|
|
85
|
+
- cojson@0.7.34
|
|
79
86
|
|
|
80
87
|
## 0.7.34-neverthrow.8
|
|
81
88
|
|
|
82
89
|
### Patch Changes
|
|
83
90
|
|
|
84
|
-
-
|
|
85
|
-
|
|
91
|
+
- Updated dependencies
|
|
92
|
+
- cojson@0.7.34-neverthrow.8
|
|
86
93
|
|
|
87
94
|
## 0.7.34-neverthrow.7
|
|
88
95
|
|
|
89
96
|
### Patch Changes
|
|
90
97
|
|
|
91
|
-
-
|
|
92
|
-
|
|
98
|
+
- Updated dependencies
|
|
99
|
+
- cojson@0.7.34-neverthrow.7
|
|
93
100
|
|
|
94
101
|
## 0.7.34-neverthrow.4
|
|
95
102
|
|
|
96
103
|
### Patch Changes
|
|
97
104
|
|
|
98
|
-
-
|
|
99
|
-
|
|
105
|
+
- Updated dependencies
|
|
106
|
+
- cojson@0.7.34-neverthrow.4
|
|
100
107
|
|
|
101
108
|
## 0.7.34-neverthrow.3
|
|
102
109
|
|
|
103
110
|
### Patch Changes
|
|
104
111
|
|
|
105
|
-
-
|
|
106
|
-
|
|
112
|
+
- Updated dependencies
|
|
113
|
+
- cojson@0.7.34-neverthrow.3
|
|
107
114
|
|
|
108
115
|
## 0.7.34-neverthrow.2
|
|
109
116
|
|
|
110
117
|
### Patch Changes
|
|
111
118
|
|
|
112
|
-
-
|
|
119
|
+
- Remove WS buffer filling log message
|
|
113
120
|
|
|
114
121
|
## 0.7.34-neverthrow.1
|
|
115
122
|
|
|
116
123
|
### Patch Changes
|
|
117
124
|
|
|
118
|
-
-
|
|
119
|
-
|
|
125
|
+
- Updated dependencies
|
|
126
|
+
- cojson@0.7.34-neverthrow.1
|
|
120
127
|
|
|
121
128
|
## 0.7.34-neverthrow.0
|
|
122
129
|
|
|
123
130
|
### Patch Changes
|
|
124
131
|
|
|
125
|
-
-
|
|
126
|
-
|
|
132
|
+
- Updated dependencies
|
|
133
|
+
- cojson@0.7.34-neverthrow.0
|
|
127
134
|
|
|
128
135
|
## 0.7.33
|
|
129
136
|
|
|
130
137
|
### Patch Changes
|
|
131
138
|
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
139
|
+
- fdde8db: Handle ws closing while buffering
|
|
140
|
+
- 07fe2b9: Wait if WS buffer is full
|
|
141
|
+
- 3bf5127: Allow crashing whole node on peer errors
|
|
142
|
+
- Updated dependencies [b297c93]
|
|
143
|
+
- Updated dependencies [3bf5127]
|
|
144
|
+
- Updated dependencies [a8b74ff]
|
|
145
|
+
- Updated dependencies [db53161]
|
|
146
|
+
- cojson@0.7.33
|
|
140
147
|
|
|
141
148
|
## 0.7.33-hotfixes.5
|
|
142
149
|
|
|
143
150
|
### Patch Changes
|
|
144
151
|
|
|
145
|
-
-
|
|
146
|
-
|
|
152
|
+
- Updated dependencies
|
|
153
|
+
- cojson@0.7.33-hotfixes.5
|
|
147
154
|
|
|
148
155
|
## 0.7.33-hotfixes.4
|
|
149
156
|
|
|
150
157
|
### Patch Changes
|
|
151
158
|
|
|
152
|
-
-
|
|
153
|
-
|
|
159
|
+
- Updated dependencies
|
|
160
|
+
- cojson@0.7.33-hotfixes.4
|
|
154
161
|
|
|
155
162
|
## 0.7.33-hotfixes.3
|
|
156
163
|
|
|
157
164
|
### Patch Changes
|
|
158
165
|
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
|
|
166
|
+
- Allow crashing whole node on peer errors
|
|
167
|
+
- Updated dependencies
|
|
168
|
+
- cojson@0.7.33-hotfixes.3
|
|
162
169
|
|
|
163
170
|
## 0.7.33-hotfixes.2
|
|
164
171
|
|
|
165
172
|
### Patch Changes
|
|
166
173
|
|
|
167
|
-
-
|
|
174
|
+
- Handle ws closing while buffering
|
|
168
175
|
|
|
169
176
|
## 0.7.33-hotfixes.1
|
|
170
177
|
|
|
171
178
|
### Patch Changes
|
|
172
179
|
|
|
173
|
-
-
|
|
180
|
+
- Wait if WS buffer is full
|
|
174
181
|
|
|
175
182
|
## 0.7.33-hotfixes.0
|
|
176
183
|
|
|
177
184
|
### Patch Changes
|
|
178
185
|
|
|
179
|
-
-
|
|
180
|
-
|
|
186
|
+
- Updated dependencies
|
|
187
|
+
- cojson@0.7.33-hotfixes.0
|
|
181
188
|
|
|
182
189
|
## 0.7.31
|
|
183
190
|
|
|
184
191
|
### Patch Changes
|
|
185
192
|
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
|
|
193
|
+
- Properly close connecting websockets
|
|
194
|
+
- Updated dependencies
|
|
195
|
+
- cojson@0.7.31
|
|
189
196
|
|
|
190
197
|
## 0.7.30
|
|
191
198
|
|
|
192
199
|
### Patch Changes
|
|
193
200
|
|
|
194
|
-
-
|
|
201
|
+
- Immediately resolve an already-open websocket
|
|
195
202
|
|
|
196
203
|
## 0.7.29
|
|
197
204
|
|
|
198
205
|
### Patch Changes
|
|
199
206
|
|
|
200
|
-
-
|
|
201
|
-
|
|
207
|
+
- Updated dependencies
|
|
208
|
+
- cojson@0.7.29
|
|
202
209
|
|
|
203
210
|
## 0.7.28
|
|
204
211
|
|
|
205
212
|
### Patch Changes
|
|
206
213
|
|
|
207
|
-
-
|
|
208
|
-
|
|
214
|
+
- Updated dependencies
|
|
215
|
+
- cojson@0.7.28
|
|
209
216
|
|
|
210
217
|
## 0.7.27
|
|
211
218
|
|
|
212
219
|
### Patch Changes
|
|
213
220
|
|
|
214
|
-
-
|
|
221
|
+
- Option to not expect pings
|
|
215
222
|
|
|
216
223
|
## 0.7.26
|
|
217
224
|
|
|
218
225
|
### Patch Changes
|
|
219
226
|
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
|
|
227
|
+
- Remove Effect from jazz/cojson internals
|
|
228
|
+
- Updated dependencies
|
|
229
|
+
- cojson@0.7.26
|
|
223
230
|
|
|
224
231
|
## 0.7.23
|
|
225
232
|
|
|
226
233
|
### Patch Changes
|
|
227
234
|
|
|
228
|
-
-
|
|
229
|
-
|
|
235
|
+
- Updated dependencies
|
|
236
|
+
- cojson@0.7.23
|
|
230
237
|
|
|
231
238
|
## 0.7.22
|
|
232
239
|
|
|
233
240
|
### Patch Changes
|
|
234
241
|
|
|
235
|
-
-
|
|
242
|
+
- Increase disconnect timeout for now
|
|
236
243
|
|
|
237
244
|
## 0.7.18
|
|
238
245
|
|
|
239
246
|
### Patch Changes
|
|
240
247
|
|
|
241
|
-
-
|
|
242
|
-
|
|
248
|
+
- Updated dependencies
|
|
249
|
+
- cojson@0.7.18
|
|
243
250
|
|
|
244
251
|
## 0.7.17
|
|
245
252
|
|
|
246
253
|
### Patch Changes
|
|
247
254
|
|
|
248
|
-
-
|
|
249
|
-
|
|
255
|
+
- Updated dependencies
|
|
256
|
+
- cojson@0.7.17
|
|
250
257
|
|
|
251
258
|
## 0.7.14
|
|
252
259
|
|
|
253
260
|
### Patch Changes
|
|
254
261
|
|
|
255
|
-
-
|
|
256
|
-
|
|
262
|
+
- Updated dependencies
|
|
263
|
+
- cojson@0.7.14
|
|
257
264
|
|
|
258
265
|
## 0.7.11
|
|
259
266
|
|
|
260
267
|
### Patch Changes
|
|
261
268
|
|
|
262
|
-
-
|
|
263
|
-
|
|
269
|
+
- Updated dependencies
|
|
270
|
+
- cojson@0.7.11
|
|
264
271
|
|
|
265
272
|
## 0.7.10
|
|
266
273
|
|
|
267
274
|
### Patch Changes
|
|
268
275
|
|
|
269
|
-
-
|
|
270
|
-
|
|
276
|
+
- Updated dependencies
|
|
277
|
+
- cojson@0.7.10
|
|
271
278
|
|
|
272
279
|
## 0.7.9
|
|
273
280
|
|
|
274
281
|
### Patch Changes
|
|
275
282
|
|
|
276
|
-
-
|
|
277
|
-
|
|
283
|
+
- Updated dependencies
|
|
284
|
+
- cojson@0.7.9
|
|
278
285
|
|
|
279
286
|
## 0.7.0
|
|
280
287
|
|
|
281
288
|
### Patch Changes
|
|
282
289
|
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
|
|
290
|
+
- c4151fc: Support stricter TS lint rules
|
|
291
|
+
- 21771c4: Reintroduce changes from main
|
|
292
|
+
- f0f6f1b: Clean up API more & re-add jazz-nodejs
|
|
293
|
+
- 627d895: Get rid of Co namespace
|
|
294
|
+
- a423eee: ignore error on ws close, fixing "Invalid state: Controller is already closed"
|
|
295
|
+
- Updated dependencies [1a35307]
|
|
296
|
+
- Updated dependencies [96c494f]
|
|
297
|
+
- Updated dependencies [19f52b7]
|
|
298
|
+
- Updated dependencies [d8fe2b1]
|
|
299
|
+
- Updated dependencies [1200aae]
|
|
300
|
+
- Updated dependencies [52675c9]
|
|
301
|
+
- Updated dependencies [1a35307]
|
|
302
|
+
- Updated dependencies [e299c3e]
|
|
303
|
+
- Updated dependencies [bf0f8ec]
|
|
304
|
+
- Updated dependencies [c4151fc]
|
|
305
|
+
- Updated dependencies [8636319]
|
|
306
|
+
- Updated dependencies [952982e]
|
|
307
|
+
- Updated dependencies [21771c4]
|
|
308
|
+
- Updated dependencies [69ac514]
|
|
309
|
+
- Updated dependencies [f0f6f1b]
|
|
310
|
+
- Updated dependencies [1a44f87]
|
|
311
|
+
- Updated dependencies [63374cc]
|
|
312
|
+
- cojson@0.7.0
|
|
306
313
|
|
|
307
314
|
## 0.7.0-alpha.42
|
|
308
315
|
|
|
309
316
|
### Patch Changes
|
|
310
317
|
|
|
311
|
-
-
|
|
312
|
-
|
|
318
|
+
- Updated dependencies
|
|
319
|
+
- cojson@0.7.0-alpha.42
|
|
313
320
|
|
|
314
321
|
## 0.7.0-alpha.41
|
|
315
322
|
|
|
316
323
|
### Patch Changes
|
|
317
324
|
|
|
318
|
-
-
|
|
325
|
+
- ignore error on ws close, fixing "Invalid state: Controller is already closed"
|
|
319
326
|
|
|
320
327
|
## 0.7.0-alpha.39
|
|
321
328
|
|
|
322
329
|
### Patch Changes
|
|
323
330
|
|
|
324
|
-
-
|
|
325
|
-
|
|
331
|
+
- Updated dependencies
|
|
332
|
+
- cojson@0.7.0-alpha.39
|
|
326
333
|
|
|
327
334
|
## 0.7.0-alpha.38
|
|
328
335
|
|
|
329
336
|
### Patch Changes
|
|
330
337
|
|
|
331
|
-
-
|
|
332
|
-
|
|
338
|
+
- Updated dependencies
|
|
339
|
+
- cojson@0.7.0-alpha.38
|
|
333
340
|
|
|
334
341
|
## 0.7.0-alpha.37
|
|
335
342
|
|
|
336
343
|
### Patch Changes
|
|
337
344
|
|
|
338
|
-
-
|
|
339
|
-
|
|
345
|
+
- Updated dependencies
|
|
346
|
+
- cojson@0.7.0-alpha.37
|
|
340
347
|
|
|
341
348
|
## 0.7.0-alpha.36
|
|
342
349
|
|
|
343
350
|
### Patch Changes
|
|
344
351
|
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
|
|
352
|
+
- Updated dependencies [1a35307]
|
|
353
|
+
- Updated dependencies [1a35307]
|
|
354
|
+
- cojson@0.7.0-alpha.36
|
|
348
355
|
|
|
349
356
|
## 0.7.0-alpha.35
|
|
350
357
|
|
|
351
358
|
### Patch Changes
|
|
352
359
|
|
|
353
|
-
-
|
|
354
|
-
|
|
360
|
+
- Updated dependencies
|
|
361
|
+
- cojson@0.7.0-alpha.35
|
|
355
362
|
|
|
356
363
|
## 0.7.0-alpha.29
|
|
357
364
|
|
|
358
365
|
### Patch Changes
|
|
359
366
|
|
|
360
|
-
-
|
|
361
|
-
-
|
|
362
|
-
|
|
367
|
+
- Reintroduce changes from main
|
|
368
|
+
- Updated dependencies
|
|
369
|
+
- cojson@0.7.0-alpha.29
|
|
363
370
|
|
|
364
371
|
## 0.7.0-alpha.28
|
|
365
372
|
|
|
366
373
|
### Patch Changes
|
|
367
374
|
|
|
368
|
-
-
|
|
369
|
-
|
|
375
|
+
- Updated dependencies
|
|
376
|
+
- cojson@0.7.0-alpha.28
|
|
370
377
|
|
|
371
378
|
## 0.7.0-alpha.27
|
|
372
379
|
|
|
373
380
|
### Patch Changes
|
|
374
381
|
|
|
375
|
-
-
|
|
376
|
-
|
|
382
|
+
- Updated dependencies
|
|
383
|
+
- cojson@0.7.0-alpha.27
|
|
377
384
|
|
|
378
385
|
## 0.7.0-alpha.24
|
|
379
386
|
|
|
380
387
|
### Patch Changes
|
|
381
388
|
|
|
382
|
-
-
|
|
383
|
-
|
|
389
|
+
- Updated dependencies
|
|
390
|
+
- cojson@0.7.0-alpha.24
|
|
384
391
|
|
|
385
392
|
## 0.7.0-alpha.11
|
|
386
393
|
|
|
387
394
|
### Patch Changes
|
|
388
395
|
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
|
|
396
|
+
- Support stricter TS lint rules
|
|
397
|
+
- Updated dependencies
|
|
398
|
+
- cojson@0.7.0-alpha.11
|
|
392
399
|
|
|
393
400
|
## 0.7.0-alpha.10
|
|
394
401
|
|
|
395
402
|
### Patch Changes
|
|
396
403
|
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
|
|
404
|
+
- Clean up API more & re-add jazz-nodejs
|
|
405
|
+
- Updated dependencies
|
|
406
|
+
- cojson@0.7.0-alpha.10
|
|
400
407
|
|
|
401
408
|
## 0.5.2-alpha.2
|
|
402
409
|
|
|
403
410
|
### Patch Changes
|
|
404
411
|
|
|
405
|
-
-
|
|
412
|
+
- Get rid of Co namespace
|
|
406
413
|
|
|
407
414
|
## 0.5.2-alpha.1
|
|
408
415
|
|
|
409
416
|
### Patch Changes
|
|
410
417
|
|
|
411
|
-
-
|
|
412
|
-
|
|
418
|
+
- Updated dependencies
|
|
419
|
+
- cojson@0.7.0-alpha.1
|
|
413
420
|
|
|
414
421
|
## 0.5.2-alpha.0
|
|
415
422
|
|
|
416
423
|
### Patch Changes
|
|
417
424
|
|
|
418
|
-
-
|
|
419
|
-
|
|
425
|
+
- Updated dependencies
|
|
426
|
+
- cojson@0.7.0-alpha.0
|
|
420
427
|
|
|
421
428
|
## 0.5.1
|
|
422
429
|
|
|
423
430
|
### Patch Changes
|
|
424
431
|
|
|
425
|
-
-
|
|
426
|
-
|
|
432
|
+
- Updated dependencies
|
|
433
|
+
- cojson@0.6.0
|
|
427
434
|
|
|
428
435
|
## 0.5.0
|
|
429
436
|
|
|
430
437
|
### Minor Changes
|
|
431
438
|
|
|
432
|
-
-
|
|
439
|
+
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
|
|
433
440
|
|
|
434
441
|
### Patch Changes
|
|
435
442
|
|
|
436
|
-
-
|
|
437
|
-
|
|
443
|
+
- Updated dependencies
|
|
444
|
+
- cojson@0.5.0
|
|
@@ -3,7 +3,7 @@ export const MAX_OUTGOING_MESSAGES_CHUNK_BYTES = 25000;
|
|
|
3
3
|
export class BatchedOutgoingMessages {
|
|
4
4
|
constructor(send) {
|
|
5
5
|
this.send = send;
|
|
6
|
-
this.backlog =
|
|
6
|
+
this.backlog = "";
|
|
7
7
|
this.timeout = null;
|
|
8
8
|
}
|
|
9
9
|
push(msg) {
|
|
@@ -15,7 +15,7 @@ export class BatchedOutgoingMessages {
|
|
|
15
15
|
const backlogExists = this.backlog.length > 0;
|
|
16
16
|
if (maxChunkSizeReached && backlogExists) {
|
|
17
17
|
this.sendMessagesInBulk();
|
|
18
|
-
this.backlog = addMessageToBacklog(
|
|
18
|
+
this.backlog = addMessageToBacklog("", msg);
|
|
19
19
|
this.timeout = setTimeout(() => {
|
|
20
20
|
this.sendMessagesInBulk();
|
|
21
21
|
}, 0);
|
|
@@ -33,7 +33,7 @@ export class BatchedOutgoingMessages {
|
|
|
33
33
|
}
|
|
34
34
|
sendMessagesInBulk() {
|
|
35
35
|
this.send(this.backlog);
|
|
36
|
-
this.backlog =
|
|
36
|
+
this.backlog = "";
|
|
37
37
|
}
|
|
38
38
|
close() {
|
|
39
39
|
this.sendMessagesInBulk();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchedOutgoingMessages.js","sourceRoot":"","sources":["../src/BatchedOutgoingMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAM,CAAC;AAExD,MAAM,OAAO,uBAAuB;
|
|
1
|
+
{"version":3,"file":"BatchedOutgoingMessages.js","sourceRoot":"","sources":["../src/BatchedOutgoingMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAM,CAAC;AAExD,MAAM,OAAO,uBAAuB;IAIlC,YAAoB,IAAgC;QAAhC,SAAI,GAAJ,IAAI,CAA4B;QAH5C,YAAO,GAAW,EAAE,CAAC;QACrB,YAAO,GAAyC,IAAI,CAAC;IAEN,CAAC;IAExD,IAAI,CAAC,GAAgB;QACnB,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,mBAAmB,GACvB,OAAO,CAAC,MAAM,IAAI,iCAAiC,CAAC;QACtD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QAE9C,IAAI,mBAAmB,IAAI,aAAa,EAAE,CAAC;YACzC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC5C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,EAAE,CAAC,CAAC,CAAC;QACR,CAAC;aAAM,IAAI,mBAAmB,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,EAAE,CAAC,CAAC,CAAC;QACR,CAAC;IACH,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ function createPingTimeoutListener(enabled, callback) {
|
|
|
7
7
|
if (!enabled) {
|
|
8
8
|
return {
|
|
9
9
|
reset() { },
|
|
10
|
-
clear() { }
|
|
10
|
+
clear() { },
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
let pingTimeout = null;
|
|
@@ -20,7 +20,7 @@ function createPingTimeoutListener(enabled, callback) {
|
|
|
20
20
|
},
|
|
21
21
|
clear() {
|
|
22
22
|
pingTimeout && clearTimeout(pingTimeout);
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function waitForWebSocketOpen(websocket) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAO,CAAC;AACpC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAWhD,SAAS,yBAAyB,CAAC,OAAgB,EAAE,QAAoB;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,KAAK,KAAI,CAAC;YACV,KAAK,KAAI,CAAC;SACX,CAAC;IACJ,CAAC;IAED,IAAI,WAAW,GAAyC,IAAI,CAAC;IAE7D,OAAO;QACL,KAAK;YACH,WAAW,IAAI,YAAY,CAAC,WAAW,CAAC,CAAC;YACzC,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,QAAQ,EAAE,CAAC;YACb,CAAC,EAAE,KAAM,CAAC,CAAC;QACb,CAAC;QACD,KAAK;YACH,WAAW,IAAI,YAAY,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,SAAuB;IACnD,OAAO,IAAI,OAAO,CAAO,CAAC,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gBACpD,WAAW,CAAC,KAAK,EAAE,CAAC;gBACpB,eAAe,EAAE,CAAC;gBAElB,IAAI,SAAS,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;oBAC/B,SAAS,CAAC,gBAAgB,CACxB,MAAM,EACN,SAAS,WAAW;wBAClB,SAAS,CAAC,KAAK,EAAE,CAAC;oBACpB,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;gBACJ,CAAC;qBAAM,IAAI,SAAS,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC;oBACrC,SAAS,CAAC,KAAK,EAAE,CAAC;gBACpB,CAAC;YACH,CAAC;SACF;QACD,IAAI;QACJ,YAAY,EAAE,KAAK;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAAoB;
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAAoB;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,OAAO,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAiB;IACnD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC;SAC7B,CAAC;IACb,CAAC;IAED,IAAI,CAAC;QACH,OAAO;YACL,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAE9C;SACL,CAAC;IACb,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC;QACvD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,CAAC;SACA,CAAC;IACb,CAAC;AACH,CAAC"}
|