When I look at webform submission results, I see some amount of results that look like duplicates, originating from the IP, within the same minute and with the same values for question fields. For example, in the results table of a recent survey, I see the following

SID  Time            IP Address
6195 7.10.2014 12:34 A.B.C.D
6196 7.10.2014 12:34 A.B.C.D
6197 7.10.2014 12:34 A.B.C.D

All submissions are by anonymous users and multiple different users can fill the survey from the same IP. Legitimately filling out the survey takes more than a minute. When I look at the corresponding time and IP from Apache logs I see

our.domain:80 A.B.C.D - - [07/Oct/2014:15:34:28 +0300] "GET /node/7/done?sid=6195&token=a3b2fd6ebc8bddf7a960aec5cb6ea2da HTTP/1.1" 200 2487 "http://our.domain/survey" "Mozilla/5.0 (Linux; Android 4.2.2; fi-fi; SAMSUNG GT-S7275R Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19"
our.domain:80 A.B.C.D - - [07/Oct/2014:15:34:33 +0300] "GET /node/7/done?sid=6197&token=f09b3310b3fbc0afee4d435c1870369b HTTP/1.1" 200 2488 "http://our.domain/survey" "Mozilla/5.0 (Linux; Android 4.2.2; fi-fi; SAMSUNG GT-S7275R Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19"

i.e. GET requests for the done page for SIDs 6195 and 6197, but no mention of 6196, which is in the results table. Even the two included in Apache logs are only five seconds apart.

So, my question is what happens here? In what cases would webform record multiple copies of the same submission? Is looking at the done page GETs in Apache logs a worthy point of comparison? Is it some kind of a page load retry in case of a connection error or busy server? If the duplicates are due to a page load or connection error, should Webform be expected to handle the situation without duplicates?

On a recent large survey on our previous server with Webform 6.x we saw a lot of these duplicates, about 2000 out of 8000 total with single submissions sometimes over 30 times among the results. I suspect this was because our very unprofessional previous server couldn't handle the load. On our new server with Webform 7.x and sufficient muscle I still saw 6 out of total 8000 with no match in Apache logs. Out of those six, four were with mobile user agents. So, it doesn't seem a significant problem on our new server, but this did leave me wondering.

Comments

danchadwick’s picture

Status: Active » Fixed

Did ALL this survey run with 4.1? There was a bug fixed in 4.1 where forms that fail validation and have autosave on validation error on may result in duplicates.

If that isn't the case, then I would suspect multiple clicks of the SUBMIT button or clicking the browser's BACK button and SUBMITTING again. To fight this, you can use some javascript that changes the button text and disables it after it's been click. There is a module for that, which eludes me at the moment.

otsaw’s picture

That survey ran under 7.x-4.0. And we did have some required fields there, but we didn't have the "Automatically save as draft between pages and when there are validation errors" option checked.

I'll look into those JavaScript solutions when we next have a survey to do.

danchadwick’s picture

In that case, I don't know of anything new in webform that would cause duplicates, leaving user browser click behavior as the likely cause. The POST transactions from the log might be interesting. Given the lack of the "done" GET for the missing sid, I'm thinking that they tapped twice on their Android device.

otsaw’s picture

Yes, click behaviour seems the likely fault. There are three POST requests from that IP at 15:34:26, 15:34:29 and 15:34:31.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.