-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: When trying to resend email in Organization tab it throws AppwriteException #5901
Comments
On the backend, the endpoint controller tries to create a whole new membership, which is expected from it: appwrite/app/controllers/api/teams.php Lines 525 to 535 in 06570a0
Considering the fact that the email delivery is in the same endpoint, can't we do something like:
Looking at the console API calls, this endpoint would be called only when a brand new membership is being created and when trying to resend an email, so this should be a viable fix. What do you think? Edit: I would love to work on this issue 😁 |
I've seen the code and it seems like letting the code keep running on catching a Changed the code from this: try {
$membership = Authorization::skip(fn() => $dbForProject->createDocument('memberships', $membership));
} catch (Duplicate $th) {
throw new Exception(Exception::TEAM_INVITE_ALREADY_EXISTS);
} to this: try {
$membership = Authorization::skip(fn() => $dbForProject->createDocument('memberships', $membership));
} catch (Duplicate $th) {
null;
} catch (Exception $th) {
throw new Exception($th->getMessage());
} I haven't been able to generate a case where an error actually gets thrown, so would appreciate feedback on the above approach! |
👟 Reproduction steps
Try to hit resend on an unclaimed email invite
👍 Expected behavior
resend the email
👎 Actual Behavior
Appwrite Exception
![image](https://private-user-images.githubusercontent.com/16495679/256932550-3c54598b-8b6b-4bd0-9783-98ac80c1a2cb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzMTQzMzYsIm5iZiI6MTcyMTMxNDAzNiwicGF0aCI6Ii8xNjQ5NTY3OS8yNTY5MzI1NTAtM2M1NDU5OGItOGI2Yi00YmQwLTk3ODMtOThhYzgwYzFhMmNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE4VDE0NDcxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5OGU4M2M0MDVkNTExZDdhMzRmMmZlOGRjNTFmZDNhODAyYjAwNzU2OWQ1OWUxZTg3N2VhMmI1YTVhMDMzMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mDjoI_eA9f7nOPmSkSLzwqAFA1loi-dyfUrulO-Pk2o)
🎲 Appwrite version
Version 1.3.x
💻 Operating system
Linux
🧱 Your Environment
1.3.8, Cloudflare, Appwrite is self hosted as a reverse proxy using Nginx
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: