Fix false "start_url is missing" validation error for manifests without name field #5121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When opening the "Edit your manifest" modal for certain websites (e.g., SoundCloud), the Settings tab incorrectly displayed an error message "start_url is required and is missing from your manifest" even though the
start_urlfield was present and populated in the input field.Screenshots showing the issue:
Root Cause
The issue was caused by two related bugs in the manifest editor:
1. Conditional Validation Trigger (Primary Issue)
All manifest form components had faulty
hasChangedlogic that only triggered validation when the manifest had a truthynamefield:For manifests without a
namefield (or with an emptynameremoved byremoveEmptyFields), themanifestInitializedflag was never set totrue, so validation never executed during component initialization. This led to the form rendering with populated input fields but incorrect validation states.2. Object Mutation (Secondary Issue)
The
removeEmptyFieldsmethod created a reference instead of a copy, mutating the original manifest object:Solution
Fixed Validation Trigger
Simplified the
hasChangedlogic to trigger validation for all manifests:Applied this fix to all 6 form components:
manifest-settings-form.ts(where the error appeared)manifest-info-form.tsmanifest-icons-form.tsmanifest-platform-form.tsmanifest-screenshots-form.tsmanifest-share-form.tsFixed Object Mutation
Changed
removeEmptyFieldsto create a proper copy:Impact
Before:
namefield showed false validation errorsAfter:
Testing
Files Changed
Fixes #[issue number]
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
webboard.app/usr/local/bin/node /home/REDACTED/work/PWABuilder/PWABuilder/libraries/manifest-validation/test/validation-tests.mjs(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.