Concurrent ajax submits cause user data loss

Created on 24 November 2016, almost 9 years ago
Updated 1 February 2023, over 2 years ago

Problem/Motivation

Execute two ajax requests - the first one has a processing time of e.g. 5 seconds and the second one of 1 second.
What now happens is that the form is processed for the first and for the second request with the initially requested form, but the second request has to be processed with the form generated by the first request, otherwise the new form array and form state generated by the second request will not have the data from the first request and caching them will overwritte the first request which on submitting the form will result in user data loss.

Attaching a patch demonstrating the problem.

Proposed resolution

Subsequent ajax requests have to wait on the previous ones before executing - however we have to still offer the ability that ajax requests could be executed regardless if another ajax request is currently running or not, only ajax requests modifying the form/the form build id have to be put in a queue or something similiar.

We need to solve this both in FormBuilder (not allowing processing of the same form build id twice) on the server side and in ajax.js (wait submitting with the same form build id) on the client side.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Needs work

Version

10.1

Component
Form 

Last updated 8 days ago

Created by

🇩🇪Germany hchonov 🇪🇺🇩🇪🇧🇬

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024