Closed samreid closed 11 months ago
The above stack trace indicates that the problem occurs in DiscreteSumEquationNode.ts.
Here's the failing assertion in EquationMarkup.ts. getSpaceMarkup
is being called with an EquationForm
that is not appropriate for the "space" domain.
function getSpaceMarkup( seriesType: SeriesType, equationForm: EquationForm, order: Order, amplitude: Amplitude ): string {
assert && assert( [ EquationForm.HIDDEN, EquationForm.WAVELENGTH, EquationForm.SPATIAL_WAVE_NUMBER, EquationForm.MODE ].includes( equationForm ),
`unsupported equationForm: ${equationForm}` );
Looking back through CT history, here are a couple more examples where getTimeMarkup
fails:
This one originates in HarmonicsEquationNode.ts:
fourier-making-waves : fuzz : unbuilt : listenerOrderRandom
http://128.138.93.172/continuous-testing/ct-snapshots/1695568347453/fourier-making-waves/fourier-making-waves_en.html?continuousTest=%7B%22test%22%3A%5B%22fourier-making-waves%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1695568347453%22%2C%22timestamp%22%3A1695573706050%7D&brand=phet&ea&fuzz&listenerOrder=random
Query: brand=phet&ea&fuzz&listenerOrder=random
Uncaught Error: Assertion failed: unsupported equationForm: WAVELENGTH
Error: Assertion failed: unsupported equationForm: WAVELENGTH
at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1695568347453/assert/js/assert.js:28:13)
at assert (EquationMarkup.ts:155:12)
at getSpaceAndTimeMarkup (EquationMarkup.ts:62:15)
at getSpecificFormMarkup (EquationMarkup.ts:47:26)
at getGeneralFormMarkup (HarmonicsEquationNode.ts:43:41)
...
This one originates in ExpandedFormDialog.ts:
fourier-making-waves : fuzz : unbuilt : listenerOrderRandom
http://128.138.93.172/continuous-testing/ct-snapshots/1695576926864/fourier-making-waves/fourier-making-waves_en.html?continuousTest=%7B%22test%22%3A%5B%22fourier-making-waves%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1695576926864%22%2C%22timestamp%22%3A1695592020686%7D&brand=phet&ea&fuzz&listenerOrder=random
Query: brand=phet&ea&fuzz&listenerOrder=random
Uncaught Error: Assertion failed: unsupported equationForm: SPATIAL_WAVE_NUMBER
Error: Assertion failed: unsupported equationForm: SPATIAL_WAVE_NUMBER
at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1695576926864/assert/js/assert.js:28:13)
at assert (EquationMarkup.ts:124:12)
at getTimeMarkup (EquationMarkup.ts:59:15)
at getSpecificFormMarkup (ExpandedFormDialog.ts:76:46)
...
Here are the 3 places where there's an ordering dependency that causes getSpaceMarkup
to fail. When domainProperty
changes before equationFormProperty
, it's possible that the assertion in EquationMarkup getSpaceMarkup
will be violated, because equationFormProperty will be stale (in transition).
DiscreteSumEquationNode.ts:
const multilink = new Multilink(
[ domainProperty, seriesTypeProperty, equationFormProperty ],
( domain, seriesType, equationForm ) => {
...
rightNode.string = EquationMarkup.getGeneralFormMarkup( domain, seriesType, equationForm );
...
} );
HarmonicsEquationNode.ts:
Multilink.multilink(
[ domainProperty, seriesTypeProperty, equationFormProperty ],
( domain, seriesType, equationForm ) => {
richText.string = EquationMarkup.getGeneralFormMarkup( domain, seriesType, equationForm );
}
);
ExpandedFormDialog.ts:
Multilink.multilink(
[ fourierSeries.numberOfHarmonicsProperty, fourierSeries.amplitudesProperty, domainProperty, seriesTypeProperty, equationFormProperty ],
( numberOfHarmonics, amplitudes, domain, seriesType, equationForm ) => {
...
expandedSumMarkup += EquationMarkup.getSpecificFormMarkup( domain, seriesType, equationForm, order, amplitude );
...
} );
To manually reproduce the error that originates in DiscreteSumEquationNode.ts:
?brand=phet&ea&debugger&listenerOrder=random(548659)
getSpaceMarkup
will fail.DiscreteModel adjusts equationFormProperty to match domainProperty:
// Ensure that the math form is appropriate for the Domain. EquationForm.MODE is supported for all Domain values.
this.domainProperty.link( () => {
if ( this.equationFormProperty.value !== EquationForm.MODE ) {
this.equationFormProperty.value = EquationForm.HIDDEN;
}
} );
So the above commit handles the intermediate state by treating it like EquationForm.HIDDEN.
I'll leave this open until I confirm that CT is happy.
FYI, I spent 1.5 hours on this. I'm not sure that it was worth it.
There has been no evidence of this error in CT, so closing.
CT Showed this error today in the 9/21/2023 5:54:46pm column:
Full details: