I have this server side code (.NET SDK):
//no label is set, but also no exception is thrown
Task<User> updateLabelTask = users.UpdateLabels(studentId, new List<string> { "student" });
Task<Membership> joinStudentsTask = teams.CreateMembership(AppwriteSettings.StudentsTeamId, new List<string>(), null, user.Id);
Task<Membership> joinSchoolTask = teams.CreateMembership(schoolId, new List<string>() {"student"}, null, user.Id);
Task<Membership> joinGroupTask = teams.CreateMembership(group.Id, new List<string>() {"student"}, null, user.Id);
Task<User> verifyTask = users.UpdateEmailVerification(user.Id, true);
await Task.WhenAll(updateLabelTask, joinStudentsTask, joinSchoolTask, joinGroupTask, verifyTask);
This works fine, except for updating the label. If instead I await the updating and only then continue with the other tasks, it works. Why could that happen? Is this an Appwrite issue?
//label is set to "student"
Task<User> updateLabelTask = users.UpdateLabels(studentId, new List<string> { "student" });
await updateLabelTask;
Task<Membership> joinStudentsTask = teams.CreateMembership(AppwriteSettings.StudentsTeamId, new List<string>(), null, user.Id);
Task<Membership> joinSchoolTask = teams.CreateMembership(schoolId, new List<string>() {"student"}, null, user.Id);
Task<Membership> joinGroupTask = teams.CreateMembership(group.Id, new List<string>() {"student"}, null, user.Id);
Task<User> verifyTask = users.UpdateEmailVerification(user.Id, true);
await Task.WhenAll(joinStudentsTask, joinSchoolTask, joinGroupTask, verifyTask);
Update: It only happens most of the time. Sometimes it works.
Recommended threads
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...