-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Enhancement] Refactor handler(Raw|Http) calls to use Promises #29
Comments
We could split this part into two, if you need help, to get some speed for reaching the milestone faster and focus on more improvements/refactoring/cleaning the code/testing. What do you think, @pocesar ? |
I'll push some of the things I've done so far, what is nagging me is the parser inside the handler methods |
In what way ? what's the bugging part? |
i synced the fork with this upstream, but I see no changes or commits. |
I didn't push yet, it's a mess (only 4 tests passing), but if you want it anyway, I can push as-is |
ok I put it in the develop branch, it's really broken right now. some places are creating internal classes inside, and expect them to |
I think I have some free time this weekend, after this I'm going to start working again. If you think you need a hand, just say, and I'll jump in. Cheers! Onto the v2.0 of json-rpc2! |
alright, if you can, I won't be able to work on it from today through sunday though. one thing, I removed the Promise.method from inside the checkAuth because it's an expensive call (it uses new Function under the hood), so having it in a frequently called function could have performance implications |
What if we use it only once, when enabling the authorization handler type On Sat, Oct 8, 2016 at 1:47 AM, Paulo Cesar [email protected]
|
Would you mind if I try a clean implementation (from where I left off) and review it in a new pull request? If not, I will try to continue from the last commit. |
yeah, that's what I did, moved the Promise.method call inside the |
Okay, I was mistaken. If we set it inside the |
any progress on this issue ? I didn't make the time to continue your efforts for closing this one during the weekend. |
nope, I'm having to finish off a platform for a startup with a tight deadline. will resume it hopefully by this weekend, but if you want to work on it, go ahead |
I managed to get a working form for handleHttp and get the jsonrpc-test.js tests working (refactored them the 'promise way' i guess). |
I managed to make the authorization tests run too. We have to make a discussion in the case the server and client have different auth types, what kind of error do we return (InternalError or InvalidParams with the error message provided in the auth handler). I checked if the message was UNAUTHORIZED (const) return InvalidParams, else return InternalError with the message provided by the developer in the handler. I will submit an early pull request to continue the discussion there for refactoring/improvements etc. Thanks! |
Are you going to take over the progress on the issue, including merge change requests and modifications? I've been uber busy these days, uni, work and bucharestjs hacks (on open data, first prize by the way ;) ) Let's have another talk on thursday (it's the first day I would be free), what do you say ? |
I merged your PR so I would be able to continue on it (unless you made some new changes). I'm almost done with a sprint here for a private project and will resume working it in the meantime. Congrats on first prize! |
Hi @pocesar , Do you want to set up a time interval to have the talk ? If you are still up for it and have the time today. Awaiting for your answer in, let's say, 2 hours (maximum 3)? It'll be the latest 10pm for me. Otherwise, schedule it for tomorrow and, if you have any changes, could you please push them on the remote ? All the best, |
To the implementators and extensions POV, refactoring a standard way using promises in those methods increase testability, interop and easier integrations. It also decouples the functionality that is currently ingrained inside those methods, and expose them for better unit testing
The text was updated successfully, but these errors were encountered: