0

When a user is added to a group using client.AddMemberToGroup(group_id, member_id) they are not appearing in the groups UI of the cPanel they are also not reported as a member when client.RetrieveAllMembers(group_id) is run.

However, when client.RetrieveGroups(member_id) is run it does return an entry in the feed for the group in question.

How do I know for sure which is correct? Is the person in the group or not?

How can I verify without doubt whether a given user is in a group or not?

I have already submited this as an issue into the issue tracker but wondered if anyone here has any ideas?

http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3327

doru
  • 9,022
  • 2
  • 33
  • 43
John
  • 1,466
  • 3
  • 21
  • 38

1 Answers1

0

If it is a very large group, it may take some time for the full group list to be refreshed and the user to appear in it.

Try waiting 24 hours and checking the CPanel / RetrieveAllMembers() calls again.

In the meantime, you're doing things right using RetrieveGroups() to determine if the user is a member.

Update: The Google CPanel and the RetrieveAllMembers() calls will never show indirect group members but your RetrieveGroups() call has direct_only set to False meaning that indirect members are being returned. If the user's you are testing for membership are indirect members then your test results are consistent with what I would expect to see.

Can you try setting direct_only to True? If that results in RetrieveGroups() no longer returning True, then we know the issue is that the user is an indirect member.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • How large is very large? The group in question has about 2500 members. I will try again tomorrow and comment back on what I find. Thanks for confirming I'm not crazy! :) – John Jan 18 '13 at 15:02
  • I'd call that large enough to cause the RetrieveMembers() API call to not be fully up to date immediately after adding the user. – Jay Lee Jan 18 '13 at 15:03
  • This doesn't seem to be the answer, I have executed tests while leaving a number of days between in order to ensure everything is up to date but I get the same mismatches. – John Jan 28 '13 at 16:32
  • Can you post your code? Can you confirm you're getting a 2xx response back on the add member API call? If that all pans out, you should probably contact Google support to report an issue (showing them how the user shows as being a member of the group with RetrieveGroups() but not RetrieveAllMembers()), I've never seen such behavior myself. – Jay Lee Jan 28 '13 at 18:17
  • Code should be here: http://code.google.com/a/google.com/p/apps-api-issues/issues/attachmentText?id=3327&aid=33270000000&name=test.py&token=iOpJzoaJ-w43Iy2Q30Ehzce2XAg%3A1359458872562 – John Jan 29 '13 at 11:28