You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the new userId value to the list of legalValues received in the response from step Agree on a license #1
For example, you may want to add a new user ID like this:
{
"value": "6880e05c-df57-4a06-af65-418e57754d19",
"description": "test2"
}
Use a PUT request to update the userId context field with the modified legalValues list:
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:
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.
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: