https://jsbin.com/zotecap/edit?html,js,output
Fragment.load({ definition: `<MyControl propertyOrAggregation="{ Invalid binding syntax "/>`, });
An exception is thrown that the binding definition couldn't be parsed or evaluated due to an invalid syntax.
No error is reported.
This happens only if a string literal was assigned to the definition setting in Fragment.load. With definition in XMLView.create, a syntax error is reported expectedly.
Hello @boghyon ,
Thank you for sharing this finding. I've created an internal incident 2080321485. The status of the issue will be updated here in GitHub.
Regards,
Florian
Good catch aind interesting issue, @boghyon !
I debugged this a bit and it seems to be a combination of two problems:
XMLTemplateProcessor stifles errors that occur for XML attributes (like the binding error), but only when the XML node that carries the attributes has no children (more concrete: the result of method syncStrategy does not consider the result of the incoming pRequireContext when there are no children)Fragment.load API is async by design, the implementation isn't yet (this is on our roadmap). There's a gap between the place where the XMLTemplateProcessor's return promise (a SyncPromise in the sync case) is converted into a sync result and the place where the Fragment.load converts the result into a standard promise. Even if issue one above is fixed, the error is thrown synchronously instead of reporting is as a promise rejection.I proposed a change internally, but colleagues might prefer to solve this together with the async implementation of the Fragment.load.
For other readers: the commit https://github.com/SAP/openui5/commit/16bdc08584c9d30ebee6746c2a2884270d692133 that closed this issue was reverted in https://github.com/SAP/openui5/commit/b06771862af6fe115d13d1effab151ccfb7b7449.
Hi @boghyon,
thanks for mentioning the revert here.
As soon as the fix is in again, we'll update the issue.
All the best,
Florian
Most helpful comment
Good catch aind interesting issue, @boghyon !
I debugged this a bit and it seems to be a combination of two problems:
XMLTemplateProcessorstifles errors that occur for XML attributes (like the binding error), but only when the XML node that carries the attributes has no children (more concrete: the result of methodsyncStrategydoes not consider the result of the incomingpRequireContextwhen there are no children)Fragment.loadAPI is async by design, the implementation isn't yet (this is on our roadmap). There's a gap between the place where theXMLTemplateProcessor'sreturn promise (aSyncPromisein the sync case) is converted into a sync result and the place where theFragment.loadconverts the result into a standard promise. Even if issue one above is fixed, the error is thrown synchronously instead of reporting is as a promise rejection.I proposed a change internally, but colleagues might prefer to solve this together with the async implementation of the
Fragment.load.