Skip to content

Studio: Improve context for errors that bubble up from wordpress-server-child - #3477

Merged
katinthehatsite merged 17 commits into
trunkfrom
add/make-child-process-errors-bubble-up
Jun 9, 2026
Merged

Studio: Improve context for errors that bubble up from wordpress-server-child#3477
katinthehatsite merged 17 commits into
trunkfrom
add/make-child-process-errors-bubble-up

Conversation

@katinthehatsite

@katinthehatsite katinthehatsite commented May 13, 2026

Copy link
Copy Markdown
Contributor

Related issues

Fixes STU-1496

How AI was used in this PR

It was used to help identify the issue.

Proposed Changes

This PR ensures that we display more detailed error message to the user from wordpress-server-child

Testing Instructions

  • Pull the changes from this branch
  • Start Studio with npm start
  • Use the broken blueprint e.g.
    broken-blueprint.json
  • Click on Add site -> Build a new site -> Upload blueprint
  • Observe that you can see more details about why the upload failed:
Screenshot 2026-05-15 at 11 12 11 AM
  • Confirm that when you open Studio logs, you can also find more details there:
Screenshot 2026-05-15 at 11 12 23 AM

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@katinthehatsite katinthehatsite self-assigned this May 13, 2026
@katinthehatsite
katinthehatsite marked this pull request as draft May 13, 2026 18:45
@wpmobilebot

wpmobilebot commented May 13, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing bfc9ba3 vs trunk

app-size

Metric trunk bfc9ba3 Diff Change
App Size (Mac) 1384.37 MB 1384.37 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk bfc9ba3 Diff Change
load 1642 ms 1668 ms +26 ms ⚪ 0.0%

site-startup

Metric trunk bfc9ba3 Diff Change
siteCreation 9007 ms 9033 ms +26 ms ⚪ 0.0%
siteStartup 4402 ms 4407 ms +5 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@katinthehatsite
katinthehatsite requested a review from a team May 15, 2026 09:41
@katinthehatsite
katinthehatsite marked this pull request as ready for review May 15, 2026 09:41
Comment thread apps/studio/src/ipc-handlers.ts Outdated
Comment thread apps/studio/src/ipc-handlers.ts Outdated
const logsDir = nodePath.join( PROCESS_MANAGER_HOME, 'logs' );
const stdoutPath = nodePath.join( logsDir, `studio-site-${ siteId }-out.log` );
const stderrPath = nodePath.join( logsDir, `studio-site-${ siteId }-error.log` );
const dateTag = new Date().toISOString().slice( 0, 10 ).replace( /-/g, '' );

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.

This can hit timezone issues, the tag here is UTC but the daemon writes the filename in local time, so the file won’t be found. I’d suggest looking up the most recent studio-site-${ siteId } log files instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I implemented this suggestion in 8b04b28

@katinthehatsite
katinthehatsite requested a review from bcotrim June 9, 2026 09:43

@bcotrim bcotrim 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.

While testing with another Blueprint, I noticed the new error parsing can show misleading errors to users.

The dialog trims the message at the first ., so URLs/domains get cut off. In this case the real URL is:

https://example.com/missing-plugin.zip

But the dialog only shows it up to https://example.:

Image

This seems to come from simplifyErrorToFirstSentence() treating any . as a sentence boundary.

Test Blueprint:

{
	"meta": {
		"title": "Broken URL Test Blueprint",
		"author": "Studio test",
		"description": "Intentionally fails while fetching a plugin ZIP from a broken URL."
	},
	"preferredVersions": {
		"php": "8.3",
		"wp": "latest"
	},
	"steps": [
		{
			"step": "installPlugin",
			"pluginData": {
				"resource": "url",
				"url": "https://example.com/missing-plugin.zip"
			}
		}
	]
}
@katinthehatsite

Copy link
Copy Markdown
Contributor Author

Thanks for the review @bcotrim ! I will take a look: I initially went with shortening because in some cases the errors were too long and too confusing to read 🙈

Kateryna Kodonenko added 2 commits June 9, 2026 14:44
…Automattic/studio into add/make-child-process-errors-bubble-up
@katinthehatsite

Copy link
Copy Markdown
Contributor Author

I made adjustments and it should now look like this:

Screenshot 2026-06-09 at 3 10 50 PM

Let me know what you think!

@katinthehatsite
katinthehatsite requested a review from bcotrim June 9, 2026 13:11

@bcotrim bcotrim 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 👍
Nice solution @katinthehatsite, thanks for making the changes

Image Image
@katinthehatsite
katinthehatsite merged commit 905c982 into trunk Jun 9, 2026
11 checks passed
@katinthehatsite
katinthehatsite deleted the add/make-child-process-errors-bubble-up branch June 9, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants