I am calling the Graph API to do the following (one after the other),
Create a new User in M365 (e.g. myNewUser)
Add the User to an existing MS Team
Create a Privtae Channel (e.g. myPrivateChannel) with the newly created user as a member
The user gets created, added to the team, channel etc., But the user was unable to access the files in the Private Channel. After some investigation I found that the user had not been added to the "Members" Group in the corresponding SharePoint Group. I manually added the user and it worked. Also if I the break the steps and give a good gap (sometimes days) between the user creation in M365 and adding the user to the Private Channel, it works (But not always though). Looks like there is a sync problem between Private Channel members and the corresponding SharePoint Group. Any help would be much appreciated.