-
Notifications
You must be signed in to change notification settings - Fork 79
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
refactor(coap-server): refactor request handling #994
refactor(coap-server): refactor request handling #994
Conversation
6ea07ac
to
095f06c
Compare
fe6f62e
to
374f8af
Compare
374f8af
to
589ffb3
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #994 +/- ##
==========================================
+ Coverage 75.61% 75.77% +0.15%
==========================================
Files 72 80 +8
Lines 14887 15290 +403
Branches 1431 1444 +13
==========================================
+ Hits 11257 11586 +329
- Misses 3597 3671 +74
Partials 33 33
|
248f19f
to
b8f7147
Compare
bc1a559
to
cc2fae6
Compare
I think this PR should now finally be ready for review :) Unfortunately, the PR size turned out to be a lot larger than originally intended. However, I think the code should now be more concise and hopefully also more readable, which should make it easier to extend the CoapServer in the future. Some helper functions might be able to be generalized and moved to the core package in follow-up PRs. Also, there are still some workarounds in the code referring to bugs or missing features in node-coap, some of which might be fixed in the meantime. I will investigate that and will otherwise – if the issues should still be present – try to resolve them. |
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.
I have only questions but the content of the PR looks good!
0bf0d5a
to
42cdad6
Compare
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.
PR LGTM
Some comments below.. really just comments
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.
Reviewed once again, looks good!
f635d96
to
afd41dc
Compare
Awesome, thank you :) I just squashed the commits into one – the PR would be ready to merge when you are :) CC @danielpeintner |
So in general, we had this non-written rule that once two committers agree on a PR we can merge it, but given the fact that daniel explicitly comment on this PR I would wait. It is not fixing any critical bug and there is no urgency. Is that ok @JKRhb? |
Sure, from my side we can wait for Daniel's final approval :) |
PR looks good, thanks! I will merge it right away ...
Side comment: I think we should avoid squashing commits unless there is a good reason.
What do people think. Shall we setup some kind of rules for that? |
Do you mean I don't? sorry just to understand better your point. |
I'm ok with that, but only if the changes are closely related. I would not squash if the PR is fixing two issues or dealing with multiple aspects of the code base (e.g. refactoring + fixing). |
You are right @danielpeintner, sorry for squashing a bit prematurely :/ Next time, I will wait until all final approvals are given. I guess as a general rule, maybe we can say that squashing should only be done when the reviewers gave their approval/ask a PR author to do so or during the merge process (as you've shown above). |
This PR applies some additional refactoring to the
CoapServer
class, removing some nesting from thehandleRequest
method. In follow-up PRs, the logic of this and other methods needs to be further refactored in order to reduce complexity and make the class more maintainable.