Skip to content
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

feat(users): Convert emails to lowercase from requests #6601

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ThisIsMani
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR changes will convert emails from request to lowercase before performing any DB operations.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #6600.

How did you test it?

curl --location 'http://localhost:8080/user/connect_account' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]"
}'

This email in the about request will be inserted as [email protected] in DB.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@ThisIsMani ThisIsMani added C-bug Category: Bug A-users Area: Users labels Nov 18, 2024
@ThisIsMani ThisIsMani self-assigned this Nov 18, 2024
Copy link

semanticdiff-com bot commented Nov 18, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/types/domain/user.rs  18% smaller

@ThisIsMani ThisIsMani marked this pull request as ready for review November 18, 2024 13:32
@ThisIsMani ThisIsMani requested a review from a team as a code owner November 18, 2024 13:32
Copy link
Contributor

@racnan racnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backwards compatibility ?

@ThisIsMani
Copy link
Contributor Author

Backwards compatibility ?

In sandbox,
total emails > 7000
emails with uppercase = 229
emails with uppercase + their lowercase counterparts = 306
single emails with uppercase = 152

We will be replacing all the 152 users with their lowercase emails.

Since any of the invited users in sandbox are not having uppercase letters, we will be not touching the users with multiple emails with different cases. And they will only be able to login to their lowercase emails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(users): Only use lowercase letters in emails
3 participants