Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://eaflood.atlassian.net/browse/WATER-4039 Phew! Somehow when looking into why there were errors during an import process we've ended up needing to upgrade Hapi! In order to better debug issues with the NALD import process we wanted to add a new POST endpoint that would allow us to trigger it manually. But when we did we saw the request logged but nothing was actually firing. The handler would not be called and the request would not disconnect leaving Postman whirring away. We quickly spotted `GET` requests were fine it was just `POST` failing. Hmm 🤔 Some Googling later and we found we were not alone - [POST request not completing on postman](https://stackoverflow.com/a/72642389/6117745) - [Hapi js server does not respond to my post route](https://www.reddit.com/r/node/comments/syq6t0/hapi_js_server_does_not_respond_to_my_post_route/?utm_source=share&utm_medium=web2x&context=3) - [https://github.com/hapijs/hapi/issues/4315](request disconnect event does not trigger for certain HTTP methods under node v16) It seems the root cause is running Hapi on Node v16 which we are doing in our local dev environment. In our AWS environments we're running v14 but we intend to upgrade as soon as SROC supplementary billing is shipped. So, we know this project is fine in AWS running v14 which concurs with those posts. But we also know apps like [water-abstraction-service](https://github.com/DEFRA/water-abstraction-service) are handling `POST` requests fine in our local dev environment. The difference is the version of Hapi; they are running v21 but the import service is running v18. This change updates Hapi to v21 (and anything else needed along the way) in order to resolve this issue and get the project ready for upgrading all our environments to v16.
- Loading branch information