SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.92k stars 1.23k forks source link

Eventbus.publish calls its listeners without a try catch #3988

Closed Johan482 closed 3 months ago

Johan482 commented 4 months ago

OpenUI5 version:

Any (originally found in 1.108.15 but the relevant code has not changed since)

Browser/version (+device/version):

Firefox 123.0 (64-Bit)

URL (minimal example if possible):

I created a small example based on the openui5 sample app (only changed the controller and view) https://github.com/Johan482/minExampleSAPUI5NoTryCatchEventbus It has 2 buttons which each publish an event that has 2 listeners.

  1. The normal button simply logs in both listeners
  2. The dump button throws an error in the first and logs in the second

Steps to reproduce the problem:

  1. Open the example and start the webserver grafik
  2. Open the console
  3. Click on the button "Publish the normal event" grafik
  4. Click on the button "Publish the dump event" grafik

What is the expected result? In both cases the data is correctly published and the second listener has no errors. Therefore second listener should be called regardless of what happens in any others.

What happens instead? The listeners are called in a loop without any errorhandling, so any errors cause subsequent listeners to no longer be called. In this case step 5 does not call the second listener.

Any other information? (attach screenshot if possible) The problem is in src/sap.ui.core/src/sap/ui/core/EventBus.js L. 231 grafik A try catch statement is needed either here or in the _callListener function

IlianaB commented 4 months ago

Hello @Johan482 , Thank you for sharing this finding. I've created an internal incident DINC0085566. The status of the issue will be updated here in GitHub.

Regards, Iliana