-
Notifications
You must be signed in to change notification settings - Fork 2
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
"environment" is removed from header in getService() in version 1.8.x #47
Comments
Hi, @zxm5010 thanks for writing us. We have removed the environment from the header. As per the documentation environment should go with Query Parameters see the documentation. |
Thanks @ishaileshmishra . We will add environment as a query param. So the environment passed into Stack constructor is no longer needed or used internally? Second question: |
1 - You don't need to add environment as a query param. we handle it internally. We are trying to reproduce the said issue at our end |
1 - Quick clarification, we are always getting For more context, we are fetching nested contents. And, nested fetches are called in the onCompletion method. Example:
Not sure if there's any behavior changes internally how the requests getting handled, but the logic mentioned above behaves fine in version 1.4.x, but start to behave unstable in 1.8.x |
@zxm5010 Please update your contentstack-java dependency to v1.9.0, |
We upgraded from 1.4 to 1.8 recently, and noticed an issue in recent 1.8.x versions that the following fetches after first one fails because of error:
"error_message":"Failed to fetch entries. Please try again with valid parameters.","error_code":141,"errors":{"environment":["is required."]}}
I think this line causes an issue
contentstack-java/src/main/java/com/contentstack/sdk/CSHttpConnection.java
Line 187 in 0e3d917
The "environment" gets removed from any
getService
call, which causes the issue.We have a workaround now is to call
setHeader
every time before making fetch calls, please provide a fix for it. Thank you!The text was updated successfully, but these errors were encountered: