Patternslib / Patterns

Library for quickly applying rich interaction patterns without the need to write any JavaScript.
http://patternslib.com
Other
103 stars 43 forks source link

Data loss when form that has running auto submits in it is submitted #1164

Open cornae opened 1 year ago

cornae commented 1 year ago

Consider a form with an autosubmit subform inside of it. The user makes a change within the subform. There's a delay set of 3 seconds. Within those 3 seconds the user clicks on the submit button of the entire form, return to the view and establishes that the last edited content within the subform is lost.

Would it be a good idea to cancel all subform auto submits once a manual submit for the entire form is fired?

pilz commented 1 year ago

This is a symptom of a larger problem. It is e.g. also possible that you upload a file and make a change and the order of the subforms are reversed, then we have data loss. And it also hooks into two people having the same item open. Lots of potential conflicts here, we just survive because it doesn't happen too often.

Also in the above scenario, submitting the whole form should have submitted the changes in the subform as well, so they should not have been lost. More investigation is needed.

This is just to mark that we must have a larger discussion if we want to fix it and that making a small patch is unlikely to help.