-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove redundant serialization and deserialization in printer #129
Conversation
Changes look good overall! Continuing the discussion from #128, I wonder what we should do about the out-of-order serialization of fields. It's not a problem to simply update the failing tests, in theory, but now I realize that the serialization order of request fields is now inconsistent between client-to-server messages and server-to-client messages, since they aren't relying on the same |
An alternative approach I just thought of which still has a two-step serialization process, but reuses the upstream |
Okay, I've opened #131 which would unblock us from working on refactoring BTW, I also merged a tiny logging PR in the meantime, so I'm sorry for rendering your PR out of date. Would you mind kindly rebasing your PR against |
4387743
to
d238ce9
Compare
@ebkalderon What do you think of testing the current (custom struct) implementation with deserialinzing the strings into maps and comparing them? I've pushed a commit that changes the tests to compare the parsed But if you would prefer to use |
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.
Sorry for the delayed response, @icsaszar. I just got a little busy. Thank you very much for the PR!
It looks like the struct serialization technique works great! I also stress-tested the old and new serialization functions by changing out the request_serialization_ok()
test to use Initialize
and a fully populated InitializeParams
instead, everything passed. 🎉 I think it should be safe to remove the make_request_old()
and make_notification_old()
functions completely.
I also left a few suggestions in the review comments below.
Also, since #131 has been merged, please consider rebasing your PR against the latest After this PR gets merged, I'll get started on refactoring |
929be1d
to
f2e1339
Compare
@ebkalderon I made the requested changes.
I've also removed the tests that used these since without the reference values, there isn't much we can test. |
Looks terrific, thank you! |
Affects #128.