Missing value for od_group_add & od_group_remove

I'm writing ES client, as part of that I want to monitor when an user is being added/removed to/from a group. From my understanding I should be able to get the name of the user with

msg->event.od_group_remove->member->member_value.name.data

but it looks like this field gets populated randomly. I will trigger similiar event a couple of times, for example adding user to a group and on one occasion this will hold value, on another it will be empty.

I also tried to check different fields, and surprisingly

od_create_user->user_name

holds the name of the group I am editing, not the name of the user I am adding to the group (but I'm not sure if it should even be engaged at this point).

Am I missing something? Is there a workaround? Or is this a bug?

Answered by DTS Engineer in 802058022

Please see what eslogger reports for this event. This is a useful test because:

  • If eslogger shows the right values, we should look more carefully at your code.

  • OTOH, if eslogger has the same problem, that’s a bug.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I also want to mention that I did try to retrieve UUID instead and convert the value using uuid_unparse and later fetch the username based on the UUID but again, the UUID value was correct only sometimes and most of the time it did not correspond to the actual username (or any username)

Accepted Answer

Please see what eslogger reports for this event. This is a useful test because:

  • If eslogger shows the right values, we should look more carefully at your code.

  • OTOH, if eslogger has the same problem, that’s a bug.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you Eskimo, with sudo eslogger od_group_add od_group_remove > es_apple.log I checked and it turns out that for the event of either adding/removing user, two notifications are being sent. One has UUID populated and username empty, while the other one has username populated and UUID empty.

So depending on the timing my client was picking either of those and filtering for username or UUID was giving weird results.

I've put in the check msg->event.od_group_add->member->member_type == ES_OD_MEMBER_TYPE_USER_NAME and it fixed it as it's only processing now the event that has username

Missing value for od_group_add & od_group_remove
 
 
Q