-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update to Node.js 22 #848
Update to Node.js 22 #848
Conversation
Deployment previews on netlify for branch
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the login HTTP call change is something we should be doing. Is there are particular reason this is now needed as part of the upgrade?
const { data } = await call | ||
return data | ||
} catch (err) { | ||
if (err.response.code === '401') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not safe to remove the 401 check which was deliberately introduced here 00120ef
When loading the application, a call against login is made to check whether the user is already logged in. If a 401 is returned, this means the user is not, but it's an expected outcome, so null
is being returned instead of throwing an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 401 check doesn't work because response.code
is always undefined. That's why I switched to using response.status
in my latest patch. Therefore, this code snippet was already throwing an error on every page load for unauthenticated users. But even if this did return null for 401s, this would still throw an error in store/auth.js
because null can't be destructured in .then(({ user }) => {...}
.
@@ -48,7 +48,9 @@ const actions = { | |||
}) | |||
.catch((error) => { | |||
commit('auth_error') | |||
throw error | |||
if (error.response.status !== 401) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is equivalent to what happens now as auth_error
is being comitted on 401 responses when previously it was not. API returning 401 is expected and not to be considered an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auth_error
is already being committed on 401s (see previous comment).
@@ -16,7 +16,7 @@ jobs: | |||
|
|||
strategy: | |||
matrix: | |||
node-version: [12, 14, 15] | |||
node-version: [22] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we keep other versions also? We always run different versions before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to always test the current version and then perhaps any future versions we hope to update to soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Node 22 is the newest and it runs fine. Let's merge it
No description provided.