Pending state not returned when user requests to join team #24369
-
Hi, I’m using Octokit to request the current membership status of a user in an organisation team using
Tried using these endpoints:
When that user is in the team it returns a 200 with the state as Does the pending state only apply for invites? and doesn’t work when requesting to join? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi, hi @AlfieBrooks 👋 I went ahead and reproduced this by:
Between each step, I tried each endpoint:
What I found, is that when the user requested access to the Team…
…and …an empty array:
When the invitation was sent to a user not already within the Org to join the Team…
So to your question:
That really does seem to be what’s happening, but it’s not clear that this is expected behavior. Now that I’ve documented these steps here, I’m going to followup with our team to find out if we’re bumping up against unexpected behavior, or perhaps there was something done incorrectly in my reproduction steps. Thank you for your patience in the meantime! 🙇 |
Beta Was this translation helpful? Give feedback.
-
Hi again @AlfieBrooks o/ How are you going? I just wanted to followup here since I did get in touch with our teams responsible for maintenance of those endpoints and do have some clarification to add to my post above. When a user has a pending invitation to join a team, we consider their membership to be pending. When a user has requested to join a team, we consider them to have an inactive membership, so that’s why we see the 404 and empty array response. We don’t necessarily want to treat a membership request to be a pending membership, as users could essentially request to join any number of teams without any guarantee that their requests would be accepted. So from that, I think there may be some pending cleanup that we could do, here: docs.github.comTeams - GitHub Docs…where:
…could be a bit ambiguous. Curious to know what you think, but also want to thank you for elevating this and hope that the verification of expected behavior is valuable to you! Let us know. 🙇 |
Beta Was this translation helpful? Give feedback.
-
Hi @nethgato, Thanks for the response! Yeah, your findings are exactly what I was doing to reproduce this issue. It wasn’t clear for me originally that the pending state was only when a user is invited to a team and not for when requesting to join a team. That’s understandable that you wouldn’t want to return a pending state when they request if there are thousands of requests to a team. Thank you for confirming that for me! As you also mentioned, it would be good to get the docs updated to explain what counts as a pending state for a user in a team (Only having been invited to a team). Thanks again, |
Beta Was this translation helpful? Give feedback.
-
Hey @AlfieBrooks cheers! So for the docs update, there’s a couple things/options. One, I can simply open an internal issue with our docs team to suggest an update. Two, a submission from you (or anyone else reading with similar requests) via our feedback form: support.github.comShare feedback - GitHub SupportI’m happy for us to do either, or both! If you feel there is unclear language, both is probably best. If you have a preference for me submitting that directly, happy to do that, too! LMK what you think 🙇 |
Beta Was this translation helpful? Give feedback.
Hi again @AlfieBrooks o/
How are you going? I just wanted to followup here since I did get in touch with our teams responsible for maintenance of those endpoints and do have some clarification to add to my post above.
When a user has a pending invitation to join a team, we consider their membership to be pending. When a user has requested to join a team, we consider them to have an inactive membership, so that’s why we see the 404 and empty array response.
We don’t necessarily want to treat a membership request to be a pending membership, as users could essentially request to join any number of teams without any guarantee that their requests would be accepted.
So from that, I think there …