Commit e1430b0
committed
fix(module-state): guard cancelled replication results, complete watchdog test mock
A watchdog-cancelled (or any cancelled) replication fires PouchDB's
'complete' event with no `docs` at all, crashing observePouchDbReplicate's
result parsing with `Cannot read properties of undefined (reading 'map')`.
Default to an empty array instead.
Also add the missing `removeListener` mock to the watchdog test's hung
replication stub - RxJS's teardown calls it for every event registered via
`on()`, and its absence was throwing an UnsubscriptionError that left fake
timers active and timed out the next test's afterEach hook.1 parent fc578a7 commit e1430b0
2 files changed
Lines changed: 3 additions & 2 deletions
File tree
- packages/modules/state/src
- __tests__
- storage
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments