Various invites fixes (PR #13003)

GitHub

Nice! TIL about to_set

This pull request has been mentioned on Discourse Meta. There might be relevant details there: