New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle callback errors #4951
Handle callback errors #4951
Conversation
The linting process is failing on travis for node versions < 4. ESLint requires at least node version 4, as it uses some ES2015 features. |
Can you make the eslint addition a separate PR so we can merge the callback additions? Also you can just use |
var db = require('./src/database'); | ||
|
||
db.getSortedSetRange('plugins:active', 0, -1, function(err, plugins) { | ||
if (err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation is off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@barisusakli Thanks for the code review. I addressed most of the concerns you mentioned, except for one, where I posted a follow-up question. Apart from that, I also removed the ESLint part from this PR. I will create a separate PR for this 😉. |
- Resolve two DoS attack vectors <NodeBB/NodeBB#4949> - Fix the thing that caused 502s last time there was an update <NodeBB/NodeBB@3161879> - Admins can now attack the tag cloud <NodeBB/NodeBB#4795> - Logging in/out with multiple tabs open is less buggy <NodeBB/NodeBB#4950> - Fixed the timestamp not being set on replies <NodeBB/NodeBB@3b0eca3> - Fixed unnecessary page refresh when going to replied-to posts <NodeBB/NodeBB@9207d6a> - Purged topics are removed from the followed topics set <NodeBB/NodeBB#4955> - Fixed a bunch of unhandled errors <NodeBB/NodeBB#4951> - Fixed breadcrumb for account info page <NodeBB/NodeBB#4958> - Moved login session list to the account info page <NodeBB/NodeBB#4959> <NodeBB/nodebb-theme-persona#310> - Got rid of error messages about malformed URLs in the server log <NodeBB/NodeBB#4954> - **HEY GUYS they fixed "new posts made to topic" notifications going to the end of the topic** <NodeBB/NodeBB#4469>
While debugging a failing test I’ve noticed that there was an unhandled callback error in the failing test. I spent a lot of time to figure out why the assertion was failing, but the data, used in the assertion, was not present at all due to a previous error.
I’ve added eslint and enabled to rule
handle-callback-err
which can detect some unhandled errors statically. ESLint found round about 100 unhandled errors in the whole project.I tried to fix this and handle all errors properly. In some cases I was not sure if an error was ignored intentionally. So please review these changes carefully and let me know if there is such an case where the error should be ignored. Nevertheless, even if an error should be ignored I think we should at least log the error with winston.