KoalaBotUK / KoalaBot

🐨 All in one Discord bot for student societies & communities
https://KoalaBot.uk
MIT License
11 stars 8 forks source link

Unable to reverify 'gmail.com' email addresses #421

Closed Gave2Haze closed 11 months ago

Gave2Haze commented 1 year ago

Describe the bug

After the k!reVerify command is used on a particular role, users will be stripped of that role until they reverify the email that was paired with it. However, when verifying adresses with the gmail.com domain, an integrity error message occurs, looking like this:

IntegrityError
(raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(pysqlcipher3.dbapi2.IntegrityError) UNIQUE constraint failed: verified_emails.u_id, verified_emails.email
[SQL: INSERT INTO verified_emails (u_id, email) VALUES (?, ?)]
[parameters: (305629460919615490, 'rudeboiyt@gmail.com')]
(Background on this error at: https://sqlalche.me/e/14/gkpj)

Additionally, the user is not given the role in the server.

To Reproduce

  1. Verify your email to give your account a role.
  2. Type k!reVerify [role] where [role] is the role your account was given.
  3. Slide into KoalaBot's DMs and type k!verify [email] where [email] is your email.
  4. In your email inbox, copy the k!confirm command KoalaBot sent you and clap it back to KoalaBot in DMs.
  5. Observe error message.

Expected behaviour

The bot should return Your email has been verified, thank you and the user should be reassigned the role.

Screenshots

image

Additional context

Other domains tested which didn't return this error: