Github user TimBarham commented on the pull request:
https://github.com/apache/cordova-lib/pull/266#issuecomment-126670748
Made this comment offline, but decided it should be included here too... I
don't think this is the right fix - I think a more general approach would serve
use better in the long run. There may be other scenarios (now or in the future)
where we end up calling into `npm-helper` with multiple `npm` actions that
aren't triggered sequentially. I think it would be better/safer to update
`npm-helper` to handle that properly, rather than having to modify existing
cases (or remember to always do it sequentially in the future).
Since `npm-helper`'s `loadWithSettingsThenRestore()` method ensures we
always restore (even if something fails), if subsequent calls come in before
we've restored from a previous call (which is what currently triggers the
error), we can queue up those subsequent calls and process each them (and hence
fulfill the corresponding promise) only once we've restored for all the calls
that preceded it.
This shouldn't be too hard to code up, and provides us with a more robust
solution at the root of the problem.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]