-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Eliminate dependency on custom httpclient implementation #620
Comments
And this is the repo the lib is currently built from. |
I'd be interested in taking a shot at this, but it might be tricky to test. Is there a server online that I can check basic functionality against? |
@mitchellsundt over on #611, you said:
Any more info on this one? |
@alxndrsn I think this may have at least part of the explanation. For testing, what about using the Aggregate VM? Alternately, let us know what kind of server config you need and we can probably get one up for you. |
I've spent some time looking at all the places in the collect code where it is dependant on httpclient. Is the expectation to replace it with the standard HttpURLConnection or something else such Volley? Also, any tips on how to test uploading? Is there a server that I can use to test form uploading? |
Thanks for looking into it, @xsteelej. To be crystal clear, what's going on is that Collect has kept using From my quick reading about Volley, I'm not sure it would provide a ton of benefit in this context. It seems to make a big performance difference in apps that, for example, let users scroll through remotely-fetched content quickly or otherwise need to make lots of quick requests and cache content. It seems it does provide nice APIs but would require changing the structure of the code quite a bit so I think some kind of tangible benefit would need to be provided.
In terms of testing, for manual verification the default https://opendatakit.appspot.com server can be used. Is that what you were asking about? You can also set up a local Aggregate virtual machine - https://docs.opendatakit.org/aggregate-vm/. I think for automated testing mocks should be sufficient. |
Thanks for the detailed response @lognaturel, after reading more about Volley I have come to the same conclusion as you - that the refactor would be too great for the benefit it provides. I am currently targeting There is another library that I have found, that adds digest to HttpUrlConnection: bare-bones-digest. It may be worth considering that. It looks like I need to do a bit more research into ok http and HttpUrlConnection + libraries to see which one would have the least impact on the current structure of the code. Thanks for the tips on testing! |
Work in progress |
1 similar comment
Work in progress |
opendatakit-bot claim |
@xsteelej I think I could help, in case u need an extra hand.. |
@andreimarcut, thanks for the offer. I've got fairly far down the road with this one. I plan to make two pull requests:
I'm almost done with step 1 above, it would be handy for a number of eyes to look over that code and test. At stage 2, I'd like to open up a discussion about which is the best http client to use. Help would be great at this stage, especially testing. |
@xsteelej I am available to help anywhere down the road, just notify me |
Thanks @andreimarcut, I appreciate the offer 👍 |
@andreimarcut, I raised PR part 1 for this issue here: #2257. It is the refactor that will make swapping out httpclient easier. It would be great to get some feedback on this. |
Great, I'll have a look |
As discussed in the recent issue #611, rather than maintaining our own custom http client, requiring its own maintenance and fixes for issues like #199, we should instead migrate to using a more "mainstream" http implementation for android.
The ultimate reason is to essentially to eliminate the need to worry about defects and security issues requiring maintenance to keep the custom library working properly.
The text was updated successfully, but these errors were encountered: