Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Fix spontaneous simulator exits #1971

Merged
merged 3 commits into from
Jan 2, 2020
Merged

Fix spontaneous simulator exits #1971

merged 3 commits into from
Jan 2, 2020

Conversation

jorisw
Copy link
Contributor

@jorisw jorisw commented Dec 29, 2019

Fixes #1922 by calling getNext() based on record count checks rather than the unreliable .on('end') cursor event.

Fixes #1922 by calling `getNext()` based on record count checks rather than the unreliable `.on('end')` cursor event
@jorisw
Copy link
Contributor Author

jorisw commented Dec 30, 2019

I see that ES6 style code isn't making it through eslint. If you want I can try and rewrite it into ES5.

@jorisw jorisw changed the title Fix spontaneous bot exits Fix spontaneous simulator exits Dec 30, 2019
@DeviaVir
Copy link
Owner

I see that ES6 style code isn't making it through eslint. If you want I can try and rewrite it into ES5.

@jorisw depends- does it make more sense to switch to ES6 at this point?

@jorisw
Copy link
Contributor Author

jorisw commented Dec 30, 2019

I could see that that may be a bit of a big move for zenbot, as indeed all of it has been written in ES5 so far. I personally never write ES5 anymore, and Node 8.3 (the minimum version for zenbot) runs all of my ES6 code without errors.

So ideally I suppose this PR needs to go to ES5, after which it could be decided to take the project to ES6. However, as that would constitute a rewrite, that doesn't seem very feasible, therefore you could also simply decide to configure eslint to accept ES6 code, and accept this PR as it is.

@jorisw
Copy link
Contributor Author

jorisw commented Dec 30, 2019

Turns out I had sim.js in .eslintignore so that my IDE wouldn't reformat core files. I'll update the PR with something that validates.

@jorisw
Copy link
Contributor Author

jorisw commented Jan 2, 2020

I've ended up setting a modern ECMAScript version in .eslintrc, as my only alternative was to convert my changes to ugly Promise code. Since the project was already set to ES6, might as well allow developers to use await/async.

Copy link
Owner

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 great, thank you so much for contributing!

@DeviaVir DeviaVir merged commit 42cace9 into DeviaVir:unstable Jan 2, 2020
olexiyb pushed a commit to olexiyb/zenbot that referenced this pull request Feb 2, 2020
* Fix spontaneous bot exits

Fixes DeviaVir#1922 by calling `getNext()` based on record count checks rather than the unreliable `.on('end')` cursor event

* Set a somewhat recent ECMAScript version

* Clean up so eslint passes
james-ingold added a commit to james-ingold/zenbot that referenced this pull request Feb 22, 2020
DeviaVir added a commit that referenced this pull request Feb 24, 2020
* stale[bot] (#1744)

* fixing simulation stops after #1971, setImmediate in async function

Co-authored-by: Chase <chase@sillevis.net>
YarnSeemannsgarn pushed a commit to YarnSeemannsgarn/zenbot that referenced this pull request Apr 15, 2020
* Fix spontaneous bot exits

Fixes DeviaVir#1922 by calling `getNext()` based on record count checks rather than the unreliable `.on('end')` cursor event

* Set a somewhat recent ECMAScript version

* Clean up so eslint passes
YarnSeemannsgarn pushed a commit to YarnSeemannsgarn/zenbot that referenced this pull request Apr 15, 2020
* stale[bot] (DeviaVir#1744)

* fixing simulation stops after DeviaVir#1971, setImmediate in async function

Co-authored-by: Chase <chase@sillevis.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zenbot suddenly stops during longer simulations
2 participants