-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
add support for libpostal over http service, adapter pattern et al. #249
base: master
Are you sure you want to change the base?
Conversation
Okay, I noticed that the demo didn't work with this PR, so I tried to figure out why. It was pretty difficult and actually exposed an issue in the error handling for the server. I was using Portland Metro data, and was using the demo to explore, which generated the following query: This URL returns a 400 error, but also an empty JSON response, as shown below:
Diving deper, I took a look at the relevant express code: Lines 99 to 104 in 3fa614e
This code doesn't properly print the error to the response body, as Printing the error to stdout reveals the following:
So there are two issues here:
|
705290c
to
9db959d
Compare
Demo issues fixed in 6a5e084 and rebased to all 3 branches. |
449d1b4
to
538bc3c
Compare
538bc3c
to
de9206b
Compare
I just did a quick rebase of this now that #244 is merged. We can continue to test this out and hopefully merge it soon! |
de9206b
to
fb8d77e
Compare
fb8d77e
to
c09b84f
Compare
c09b84f
to
6e33f9e
Compare
Well its been a while for this one but after some of the cleanup and maintenance work we've been doing in the interpolation repository, I took another look at this. With all the better-sqlite3 stuff long since merged, this PR is a lot simpler now. I've rebased it on top of the latest changes from the The development workflow for updating the mock libpostal responses went smoothly (set up libpostal and configure the Maybe we take a look at getting this merged, since it's been quite helpful for avoiding the extra memory usage of having libpostal data loaded twice. My current questions are:
|
I agree it would be great to merge this functionality, since it provides a lot of flexibility going-forward. Regarding which adapter is appropriate for default => (HTTP | NPM) is yet to be decided. One of the complexities here is that this PR couples the adapter pattern code with a change to the default adapter to change it from NPM Module => HTTP. So.. while I'm not totally against that, the HTTP and NPM Module adapters both have pros and cons, neither is a clearly superior method to the other, but I just wanted to note that its two changes in one, which is making this harder to merge. Coupled with the unknown topic of performance (and consequently) build times it might be better to merge the code changes without changing the default adapter and then measuring the performance of different methods? Alternatively we can use the existing code to measure the performance of a full planet build using HTTP and compare it to NPM Module which should give us some more confidence that changing the default adapter is the right choice, despite the additional complexity of network service discovery and I/O. It might be worth running that build twice, since changes to how the |
this code is branched off #244, please merge that PR first!
▶️ see only the diff ◀️
this draft PR is all the best bits of #146 & #240 rebased on top of #244
See #146 for more info on the functionality and how to configure the service.
closes #146
closes #240