DateField's updateValueWithDelay and the order of Events

Hi, this is my first post to the discord, because I am facing an issue that I’d like to discuss. I am really grateful for any help.

I am experiencing weird behavior when using DateFields. DateFields make an update with delay and whenever I set the DateField value on the server side, it initiates a delayed update from the client side. This delayed update is send with the next request which can sometimes become a problem.

In our use case the user can select a record from a grid. The data of the selected element is then displayed in a form that includes DateFields.

When users are now clicking very fast, switching from one record to the next in the application, the delayed update of the DateField is send in the request together with another click event from the Grid.

I would expect that the DateFields delayed update would be processed first on the server, but unfortunately it comes after the click event from the Grid which changes the selection. It is send within one request, but the DateField update comes after the Grid selection in the request body.

As a result I have a change in the DateField of the newly selected record. On the server side I have no chance to detect the wrong order of events or is there any possibility to find out?

I think the cause for the client side triggered update lies in the AbstractTextualDateConnector.onStateChanged(). This triggers a widget.buildDate() which in case of the VAbstractPopupCalender does a sendBufferedValuesWithDelay. I did not debug that yet, but just read the code and inspected the requests.

I am using 8.14.3, but the 8.21.0 code does not look different when it comes to the DateField and the classes in its context.

I suspect this to be a bug because the changes are not processed in the right order and I am looking for any kind of workaround. As I said, I am grateful for any help.