users-email - Lowercase the email value on CRUD operations for deta and USERS kv - #49
users-email - Lowercase the email value on CRUD operations for deta and USERS kv#49ashishjullia wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| let kvUser = await USERS.get(userEmail, { type: 'json' }) | ||
| let kvUser = await USERS.get(userEmail.toLowerCase(), { type: 'json' }) |
There was a problem hiding this comment.
This would ignore issues retrospectively, such that if the KV already has the user's email in different cases, USERS.get will have a miss
There was a problem hiding this comment.
Yes, it will but that can be solved by manually making the ones already in kv USERS to lowercase and in deta collection users?
There was a problem hiding this comment.
how would you resolve this issue in a backward compatible way, without the batch update in the existing deta base?
There was a problem hiding this comment.
No, that's what I meant to solve this a bulk update is required to the existing USERS and users.
There was a problem hiding this comment.
But there is one catch here, a bulk update to lowercase the email can be done but if there is a case where there are two entries for (say) ashishjullia19@gmail.com and ASHISHJULLIA19@GMAIL.COM, then if both have a few teams/stages/key:value(s) then this process can lead to a failure in such cases where either nit-pick the ones that can be discarded from the db means whether to keep ashishjullia19@gmail.com or ASHISHJULLIA19@GMAIL.COM (other making the email lowercase).
|
fyi @woozyking attempted to fix the issue. Otherwise, currently the behaviour is as follows: |




This fixes #48