magic-js
magic-js copied to clipboard
Email update has unpredictable behaviour
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
- [x] Are you running the latest SDK version?
- [x] Are you reporting to the correct repository (
magic-sdk
)?
🐛 Description
Sometimes (more often than not) email update fails, for seemingly various reasons.
🧩 Steps to Reproduce
- Call the
updateEmail()
function
await magic.user.updateEmail({ email: '[email protected]' });
🤔 Expected behavior
Successful email update flow.
😮 Actual behavior
- Sometimes it fails with an internal server error. Upon inspecting the network response for
https://api.magic.link/v1/auth/user/email/update
endpoint we get:
error 500
{
"data": {},
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Internal Service Error.",
"status": "failed"
}
- Sometimes there is the following response from the same endpoint:
error 400
{
"data": {},
"error_code": "auth_relayer/UNABLE_TO_REFRESH_SESSION",
"message": "Unable to refresh user session. Please log in using the magic link flow to enable session persistence.",
"status": "failed"
}
- Other times, upon clicking the link in the new email we get the following view:
💻 Code Sample
[If possible, please provide a code repository, gist, code snippet or sample files to reproduce the issue.]
🌎 Environment
Software | Version(s) |
---|---|
magic-sdk |
8.1.1 |
Browser | Chrome |
yarn |
yes |
Operating System | macOS Monterey (12.1) |
This issue is inconclusive as I was unable to trigger any described error (or any errors) as described under "Actual behavior" under same environment. I'd be interested to know when the errors are being thrown and if actually by the updateEmail method itself. Additionally, I'd like to know if these errors prevented a successful email change.
The 400 error message is expected in cases where;
- A login call is made while a user is not already logged in
- Because part of the login call checks to see if a user is already logged in
- If not, that error message is returned, however the auth flow continues
Regarding the 500 error, I'd like to assist by working with you to reproduce this consistently to provide a better experience for everyone using Magic.
Closing this issue due to the following reasons:
- the error is not reproducible
- there has been no activity in the last 30 days.
@disappearer Please feel free to leave additional comments or open a new issue if these errors come up again.