You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the ability to handle duplicate records at runtime better. That is when we make queries to the DB (like at login, etc.) we should check if multiple documents are available.
If yes, we need to handle the case with proper error messages (and some dev/staff debug info like user ids, etc.)
Some ideas:
Implement an equivalent of the Loopback error handling. (Mrugesh)
Intercept the session and then check with something like user.findMany and handle it. (Oliver)
Reacted by DEEPANSHU SINGH GAUTAM, Bilal Abdul and Suboor Shaikh
@raisedadead if, by adapter, you mean Prisma, then it should be fine. We can run into problems if the shape of the document is different from the Prisma schema, but that's not the case here.
Currently what we're doing (in the new api) is getting the first user with that email:
Activity
moT01 commentedon Apr 30, 2024
Is this still mandatory or could we move this to post-mvp?
raisedadead commentedon May 6, 2024
I believe the adapter is not as forgiving as our legacy API. I will be needing to check with @ojeytonwilliams
ojeytonwilliams commentedon May 7, 2024
@raisedadead if, by adapter, you mean Prisma, then it should be fine. We can run into problems if the shape of the document is different from the Prisma schema, but that's not the case here.
Currently what we're doing (in the new api) is getting the first user with that email:
freeCodeCamp/api/src/routes/helpers/auth-helpers.ts
Lines 14 to 19 in acb38ca
raisedadead commentedon May 7, 2024
Is
findManymore expensive? I mean what is stopping us from implementing the TODO above? It would be great to log these errors right-away in sentry.ojeytonwilliams commentedon May 7, 2024
I assume they're both fast because
emailis indexed, but I don't know much about DB performance.We could try it, though.
ojeytonwilliams commentedon Jul 8, 2024
@raisedadead is there anything missing from the implementation of #55171 or can we close this?
raisedadead commentedon Jul 9, 2024
For now, it would be nice to email the user & support but that can be later.