-
Notifications
You must be signed in to change notification settings - Fork 14
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
Not all public query parameters are marked as such #974
Comments
As I was suspecting when we discussed via slack, the actual validation in context of the sim for In your test above, Friction does not appear to use ColorProfile.js, so that explains why you're not getting any dialog or sim errors. When I ran your test input on a sim that does use ColorProfile.js, it errored out from line 82 of ColorProfile.js: // Query parameter may override the default profile name.
const initialProfileName = phet.chipper.queryParameters.colorProfile || ColorProfile.DEFAULT_COLOR_PROFILE_NAME;
if ( profileNames.indexOf( initialProfileName ) === -1 ) {
throw new Error( `invalid colorProfile: ${initialProfileName}` );
} For // Query parameter may override the default profile name.
let initialProfileName = phet.chipper.queryParameters.colorProfile;
if ( profileNames.indexOf( initialProfileName ) === -1 ) {
const errorMessage = `invalid colorProfile: ${initialProfileName}`;
QueryStringMachine.addWarning( 'colorProfile', initialProfileName, errorMessage ); // public query parameters get warnings instead of errors
assert && assert( false, errorMessage ); // for running tests or development, if desired
initialProfileName = ColorProfile.DEFAULT_COLOR_PROFILE_NAME;
} Tested with Ratio and Proportion. |
I only include the |
Over in phetsims/joist#654, I saw that
?locale
and?colorProfile
are advertised to PhET-iO clients, but they aren't marked aspublic:true
in initialize globals.When I mark them as such, I don't get the out-of-the-box error dialog that I would expect, even though they both already have default values.
Here is the patch:
This link makes a dialog about incorrect parameters: http://localhost:8080/friction/friction_en.html?brand=phet-io&phetioStandalone&screens=43
This link does not: http://localhost:8080/friction/friction_en.html?brand=phet-io&phetioStandalone&colorProfile=43
@chrisklus can you help me out?
The text was updated successfully, but these errors were encountered: