This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Commit 24c2ad5
collect: respect stream pause / resume state
Without watching if a stream is already paused before calling pause(),
collect() can conflict with other users of the stream who may be
managing state, resulting in a premature collect(). This manifests in
the fstream-npm and node-tar combination where fstream-npm manages state
in readBundledLinks() at the same time collect() is processing the
stream. collect() ends up running before fstream-npm has properly set up
the _correct_ list of entries according to the ignore rules. When
collect() gets to run before this is complete, fstream starts performing
_read() operations on a non-filtered list, keeping track of entry index,
then after it starts, fstream-npm inserts a new list of entries and the
entry index is incorrect and can skip files.
Fixes: npm/npm#5082
Credit: @rvagg
Reviewed-By: @othiym23
PR-URL: #531 parent a67b90b commit 24c2ad5
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
0 commit comments