Skip to content
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

Merged
merged 6 commits into from
Aug 27, 2024
Merged

Update to Node.js 22 #848

merged 6 commits into from
Aug 27, 2024

Conversation

AndrewKostka
Copy link
Contributor

No description provided.

Copy link

Deployment previews on netlify for branch refs/pull/848/merge will be at the following locations (when build is done):

@AndrewKostka AndrewKostka marked this pull request as ready for review August 13, 2024 12:37
Copy link
Contributor

@m90 m90 left a 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') {
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

@m90 m90 Aug 14, 2024

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.

Copy link
Contributor Author

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]
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

@dati18 dati18 left a 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

@AndrewKostka AndrewKostka merged commit e4a43e0 into main Aug 27, 2024
7 checks passed
@AndrewKostka AndrewKostka deleted the use-nodejs-22 branch August 27, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants