-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
PATCH method required for /api/admin/context/{contextField} #8934
Comments
Hi. I can see the use-case for this functionality, however we have other priorities that are more pressing right now. If you would like to contribute this functionality we'd be happy to take a look at it, otherwise we'll have to revisit this in the future. |
Hello @kwasniew Thanks for your support! Could you please confirm when this change is planned for release? Additionally, we are facing a similar issue when adding whitelisted values for constraints under feature flag strategy. Is it possible to support single-value updates and deletions in this case, or is there another workaround available? |
Hi @preetiakrohilla For the strategy updates are you using UI or API? In the UI code there's a staleness check that verifies if you're looking at the most recent version. But since you mentioned threads I'm assuming you're updating them with our API. |
We are using API to update the strategy. |
Describe the feature request
Hi Team,
We have a use case where we are trying to update the Unleash UserId context field in parallel. Here are the steps we follow:
We are using REST APIs to update the context field.
curl --header "Authorization: xxxxxxxxxxxxxxxxxx" --header "Content-Type: application/json" http://localhost:4242/api/admin/context/userId
Sample response:
{
"name": "userId",
"description": "Allows you to constrain on userId",
"stickiness": false,
"sortOrder": 1,
"legalValues": [
{
"value": "aeb27c26-8952-434c-a724-e86fbd124e15",
"description": "test1"
}
],
"createdAt": "2023-10-29T13:25:26.078Z"
}
For example, you may want to add a new user ID like this:
{
"value": "6880e05c-df57-4a06-af65-418e57754d19",
"description": "test2"
}
curl --request PUT 'http://localhost:4242/api/admin/context/userId'
--header 'Authorization: xxxxxxxxxxxxxx'
--header 'Content-Type: application/json'
--data-raw '{
"name": "userId",
"description": "Allows you to constrain on userId",
"legalValues": [
{
"value": "aeb27c26-8952-434c-a724-e86fbd124e15",
"description": "test1"
},
{
"value": "6880e05c-df57-4a06-af65-418e57754d19",
"description": "test2"
}
],
"stickiness": false
}'
Potential Issue:
Two concurrent requests might lead to data overwriting on the server, as both requests may fetch the same state in step #1 and update the context field simultaneously. This can result in the loss of changes made by one request when the other request is processed later.
Background
No response
Solution suggestions
Introduce Patch Method for Unleash Rest API /api/admin/context/{contextField}
The text was updated successfully, but these errors were encountered: