Skip to content

Update playground to version 0.9.44 - #561

Merged
jeroenpf merged 2 commits into
trunkfrom
update-playground-0.9.44
Sep 26, 2024
Merged

Update playground to version 0.9.44#561
jeroenpf merged 2 commits into
trunkfrom
update-playground-0.9.44

Conversation

@jeroenpf

Copy link
Copy Markdown
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 Sep 25, 2024
@fluiddot

Copy link
Copy Markdown
Contributor

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

@fluiddot fluiddot left a comment

Copy link
Copy Markdown
Contributor

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

wojtekn commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

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

@wojtekn

wojtekn commented Sep 26, 2024

Copy link
Copy Markdown
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
wojtekn self-requested a review September 26, 2024 10:31
@wojtekn

wojtekn commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

wojtekn commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

@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

fluiddot commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

@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

@wojtekn wojtekn left a comment

Copy link
Copy Markdown
Contributor

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

fluiddot commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Is this still good for a merge?

@fluiddot

Copy link
Copy Markdown
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
@jeroenpf
jeroenpf deleted the update-playground-0.9.44 branch September 26, 2024 13:57
@fluiddot

fluiddot commented Oct 2, 2024

Copy link
Copy Markdown
Contributor

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

Labels

None yet

3 participants