Commit 3c2d0cd
authored
refactor(client): Remove
When an error occurs in message ordering, the `OrderedMsgChain` calls an `onError` callback which is registered by the `OrderMessages` class. There is a parameter in that call, but `OrderMessages` doesn't use the value.
See https://github.com/streamr-dev/network/blob/73b83c0cc2af716a3b09c71f13cb05665cee25fe/packages/client/src/subscribe/OrderMessages.ts#L51
Refactored error handler to be just a callback without arguments and removed the custom `GapFillFailedError` class.
### Open questions
In PR #1570 we changed the error handling functionality so that the pipeline can continue to process messages after error. There we consider the error case as an empty result. But if we want we could notify subscription somehow if there is an error.
If we want to notify, should we emit error only when there is a storage node error, or maybe also when we can't fill the gap (i.e. don't find the missing messages from the storage node). See: https://github.com/streamr-dev/network/blob/73b83c0cc2af716a3b09c71f13cb05665cee25fe/packages/client/test/unit/OrderedMsgChain.test.ts#L429
- If we want to notify the subscription, we should use `StreamrClientError` instead of custom `GapFillFailedError`
- It currently not possible to add error listeners for resend streams (i.e. when user calls `StreamrClient#resend()`)GapFillFailedError (#1579)1 parent 73b83c0 commit 3c2d0cd
3 files changed
Lines changed: 10 additions & 36 deletions
File tree
- packages/client
- src/subscribe/ordering
- test/unit
Lines changed: 0 additions & 17 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
| 130 | + | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| |||
322 | 321 | | |
323 | 322 | | |
324 | 323 | | |
325 | | - | |
| 324 | + | |
326 | 325 | | |
327 | 326 | | |
328 | 327 | | |
| |||
384 | 383 | | |
385 | 384 | | |
386 | 385 | | |
387 | | - | |
| 386 | + | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
| |||
411 | 410 | | |
412 | 411 | | |
413 | 412 | | |
414 | | - | |
| 413 | + | |
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
398 | 397 | | |
399 | 398 | | |
400 | 399 | | |
401 | | - | |
| 400 | + | |
402 | 401 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
412 | 405 | | |
413 | 406 | | |
414 | 407 | | |
| |||
426 | 419 | | |
427 | 420 | | |
428 | 421 | | |
429 | | - | |
| 422 | + | |
430 | 423 | | |
431 | 424 | | |
432 | 425 | | |
433 | | - | |
434 | | - | |
| 426 | + | |
435 | 427 | | |
436 | 428 | | |
437 | 429 | | |
| |||
0 commit comments