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 playground to version 0.9.44 #561

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

jeroenpf
Copy link
Contributor

Proposed Changes

  • Update Playground from 0.9.39 to version 0.9.44
  • This update contains various improvements including MySQL compatibility fixes

Testing Instructions

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@jeroenpf jeroenpf self-assigned this Sep 25, 2024
@jeroenpf jeroenpf changed the title Update playground version Update playground to version 0.9.44 Sep 25, 2024
@fluiddot
Copy link
Contributor

For reference, here are the changes introduced in Playground:
WordPress/wordpress-playground@v0.9.39...v0.9.44

Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎊 !

I've tested a site using MySQL and I didn't find any crash as outlined in #358 🎊 !

@fluiddot fluiddot linked an issue Sep 26, 2024 that may be closed by this pull request
@wojtekn
Copy link
Contributor

wojtekn commented Sep 26, 2024

Looks good. Thanks for fixing this in the upstream @jeroenpf (WordPress/wordpress-playground#1752) and upgrading Playground in Studio!

@wojtekn
Copy link
Contributor

wojtekn commented Sep 26, 2024

I've tested it more, but it seems that when I try to start the site configured to use MySQL, it crashes:

node:internal/errors:497
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "set-cookie"
    at ServerResponse.setHeader (node:_http_outgoing:655:3)
    at /Volumes/Sites/local-environment/.webpack/main/siteServerProcess.js:61899:21
    at Generator.next (<anonymous>)
    at fulfilled (/Volumes/Sites/local-environment/.webpack/main/siteServerProcess.js:61839:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_HTTP_INVALID_HEADER_VALUE'
}

Node.js v20.9.0

When I use Studio 1.1.2, it works fine.

@wojtekn wojtekn self-requested a review September 26, 2024 10:31
@wojtekn
Copy link
Contributor

wojtekn commented Sep 26, 2024

Also, it seems that the above crash happens when I'm using MySQL, but with incorrect credentials configured in wp-config.php. When I use the correct credentials, I see a broken site:

Screenshot 2024-09-26 at 12 33 44

When I use Studio 1.1.2, both cases work: incorrect credentials show the page informing me about the problems connecting to MySQL, and correct credentials show the correct site.

@fluiddot
Copy link
Contributor

I've tested it more, but it seems that when I try to start the site configured to use MySQL, it crashes:

node:internal/errors:497
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "set-cookie"
    at ServerResponse.setHeader (node:_http_outgoing:655:3)
    at /Volumes/Sites/local-environment/.webpack/main/siteServerProcess.js:61899:21
    at Generator.next (<anonymous>)
    at fulfilled (/Volumes/Sites/local-environment/.webpack/main/siteServerProcess.js:61839:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_HTTP_INVALID_HEADER_VALUE'
}

Node.js v20.9.0

When I use Studio 1.1.2, it works fine.

@wojtekn how did you reproduce it?

Based on the error message, I wonder if it's related to #532 🤔 .

@wojtekn
Copy link
Contributor

wojtekn commented Sep 26, 2024

@wojtekn how did you reproduce it?

Here are the steps:

  1. Start Studio in dev mode from this branch
  2. Add a site and open it in IDE
  3. Remove wp-content/database/, mu-plugins/sqlite-database-integration and wp-content/db.php.
  4. Open WP Admin

Expected behavior: the following page is served:
Screenshot 2024-09-26 at 12 40 16

Current behavior: site crashes with set-cookie error

@fluiddot
Copy link
Contributor

fluiddot commented Sep 26, 2024

@wojtekn how did you reproduce it?

Here are the steps:

  1. Start Studio in dev mode from this branch
  2. Add a site and open it in IDE
  3. Remove wp-content/database/, mu-plugins/sqlite-database-integration and wp-content/db.php.
  4. Open WP Admin

Expected behavior: the following page is served: Screenshot 2024-09-26 at 12 40 16

Current behavior: site crashes with set-cookie error

Ah, good catch. As I shared in #561 (comment), this is a bug most likely introduced in #532. I've pushed a fix in 0f0d45e.

Now when accessing WP-Admin in the scenario shared in #561 (comment), it shows the error page:

Captura de pantalla 2024-09-26 a las 12 47 47

Copy link
Contributor

@wojtekn wojtekn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fluiddot , works well now.

@fluiddot
Copy link
Contributor

fluiddot commented Sep 26, 2024

I encountered a weird behavior when testing a site with MySQL files inside the site's folder, specifically when having the symlink mysql.sock. I presume this is an edge case, as users won't have these files in the site's folder, however, this uncovers a bug related to not-resolvable symlinks and the site initialization. I'll open a separate GitHub issue as it's not related to this PR.

UPDATE: Here's the issue 9257-gh-Automattic/dotcom-forge.

@jeroenpf
Copy link
Contributor Author

Is this still good for a merge?

@fluiddot
Copy link
Contributor

Is this still good for a merge?

Yes, from my side it's ready to be merged :shipit: .

@jeroenpf jeroenpf merged commit 1438990 into trunk Sep 26, 2024
10 checks passed
@jeroenpf jeroenpf deleted the update-playground-0.9.44 branch September 26, 2024 13:57
@fluiddot
Copy link
Contributor

fluiddot commented Oct 2, 2024

I noticed that the patch introduced in #532 is no longer being applied is giving a warning due to version mismatch but is still being applied after upgrading the Playground dependencies. I'll open a PR to update it.

UPDATE: Here's the PR #580.

@fluiddot fluiddot mentioned this pull request Oct 2, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connecting to Remote MySQL Database Causes Local Site Server to Crash
3 participants