This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Make password reset email field case insensitive #1170
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You'll want to merge in develop |
…t_case_insensitive
done |
Looks like sqlite doesn't like your index sql |
Huh... it was fine on mine. :/ Maybe an sqlite version thing? |
Yep: https://www.sqlite.org/expridx.html - so we need version 3.9.0. Sigh. What do we want to do? |
The usual trick is to store the lower cased email in the database, so that the normal index can be used. This also neatly side steps the issues where not all 3pids are necessarily case insensitive. |
Hmm, true. I guess we could have a db script to migrate the current ones. wdyt? |
Given it can be done as a simple update, if there aren't too many rows its probably easiest just to do the update in a .sql delta |
older sqlite doesn't support indexes on expressions, lets just store things lowercase in the db
And db migration sql to convert existing addresses.
…t_case_insensitive
LGTM |
Oh, except you'll want the delta to be under 37/ |
dbkr
added a commit
that referenced
this pull request
Jan 18, 2017
Since we store all emails in the DB in lowercase (#1170)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Canonicalizes email addresses to lowercase when adding them: this is the very first step of migrating towards HSes having knowledge of and validating threepids. They still use the ID server to validate emails though.
Adds an index on email address: we didn't have one at all before, we probably should do.
Fixes SYN-788