hirosystems / stacks-blockchain-api

API for the Stacks blockchain
https://stacks-blockchain-api.vercel.app
GNU General Public License v3.0
170 stars 108 forks source link

Regression on the API status code for invalid BNS from 404 to 400 #1435

Closed pradel closed 1 year ago

pradel commented 1 year ago

Describe the bug

Looks like there is a regression in the API for the name endpoint. Calling the API https://stacks-node-api.mainnet.stacks.co/v1/names/usernameTest endpoint returns a 400 HTTP error code. Previously it was returning 404 for the same endpoint. I started to notice this issue popping around the 8/9th November.

According to the code https://github.com/hirosystems/stacks-blockchain-api/blob/master/src/api/routes/bns/names.ts#L124, the HTTP code should be 404 so maybe a new addition in the repo is overwriting the code before it's sent to the client somehow.

To Reproduce

Open https://stacks-node-api.mainnet.stacks.co/v1/names/usernameTest and see that the HTTP status code is 400.

Expected behavior

The status code should be 404 as it was before.

pradel commented 1 year ago

If I look at the beta branch I can see that the logic changed https://github.com/hirosystems/stacks-blockchain-api/blob/beta/src/api/routes/bns/names.ts#L135.

As we are relying on the status code for tests, our CI started failing when this change was released, it should be marked as a breaking change or keep the original status.

blockstack-devops commented 1 year ago

:tada: This issue has been resolved in version 6.2.0-beta.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops commented 1 year ago

:tada: This issue has been resolved in version 6.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops commented 1 year ago

:tada: This issue has been resolved in version 7.0.0-stacks-2.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: