Skip to content

sap.ui.mdc.p13n.StateUtil.resetState not correctly waiting until all changes are reset #4279

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

Open
2 tasks done
moritori opened this issue May 4, 2025 · 1 comment
Open
2 tasks done

Comments

@moritori
Copy link

moritori commented May 4, 2025

What is the issue and how can we reproduce it?

  • call StateUtil.resetState on a sap.ui.mdc.Table with enabled filters
  • destroy the table instance

In this case await StateUtil.resetState returns but some deferred code is not yet executed, then the table is destroyed and then the deferred code tries to access things belonging to the table that in the mean time no longer exist.

Following the code, the method StateUtil.resetState awaits sap.m.p13n.Engine.reset. This method returns a promise. So that is still fine. However, in e.g. version 1.135.0 in the forEach loop in line 349 of sap.m.p13n.Engine there is call to sap.ui.mdc.p13n.subcontroller.FilterController.update. This method contains unsynchronized code: createFilterFields returns a promise and is therefore deferred.

I've provided a minimal example that creates and destroys a table. You need to refresh once (to create only), then add a column or filter (to trigger the creation of a change) and then press refresh once more (to destroy and the create again).

Which OpenUI5 version is your project targeting?

1.120.x to 1.135.x

Is the issue device- or browser-specific?

No.

App.controller.js.txt
App.view.xml.txt
Component.js.txt
manifest.json
model.json
TableDelegate.js.txt

Confirmation

  • I have searched the existing issues and reviewed the relevant documentation as well as the API reference.
  • I am not disclosing any internal or sensitive information.
@NakataCode
Copy link
Contributor

Hello @moritori,

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

Best Regards,
Nikola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants