From ecd6508b95aed826c7a9daccbef54aa16fd26ed8 Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Wed, 25 Sep 2024 13:27:13 +0530 Subject: [PATCH] Add a note for not passing userContext in user get API --- recipe/dashboard/api/usersGet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipe/dashboard/api/usersGet.go b/recipe/dashboard/api/usersGet.go index c31b971d..ccb86c95 100644 --- a/recipe/dashboard/api/usersGet.go +++ b/recipe/dashboard/api/usersGet.go @@ -121,6 +121,10 @@ func UsersGet(apiImplementation dashboardmodels.APIInterface, tenantId string, o User map[string]interface{} `json:"user"` }) { defer processingGroup.Done() + + // NOTE: If userContext is passed in the following call, it could + // possibly lead to a concurrent map write error so it's important + // to be careful while adding that. userMetadataResponse, err := usermetadata.GetUserMetadata(userObj.User["id"].(string)) <-sem if err != nil {