danielsz/system

`stop-watcher` is not idempotent

johnswanson opened this issue · 3 comments

I'm using the watcher component in development to compile SCSS files. If something causes a start to fail during a reset (i.e. syntax error causes refresh to fail), it seems that stop is called twice on the watcher. Unfortunately this throws a NullPointerException.

If you'd like, I'll make a PR to make component/stop on the watcher idempotent. If you think this would be better fixed upstream (i.e. stop-watcher should just be idempotent), let me know and I'll make the case there.

Thanks!

Hi John,

PR very much welcome! Or with Chris :-)

I vote for the the best / most elegant solution, and trust your judgment.

Thank you!

Hi Daniel, opened a PR to fix this. It looks like hara outsources the issue of idempotency to the hara.component library, so I think it'd be a violation of separation of concerns to "fix" stop-watcher.

Let me know if you see any issues--thanks!

Fixed.