user request is out of synch

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

user request is out of synch

#1

Postby alexmcclune » Fri Jan 16, 2015 7:25 am

Hi,

I have a query we have recently (finally...) gone live with a few forms. Whilst pick up is slow I am monitoring each call we get for errors and this one came up. I haven't seen it before and would like to better understand it.

If I am reading it correctly the user was navigated to the POSTFORM page before navigating back to the FORMDETAILS page. At which point the error was logged as "ERROR Server Error: null" due to "Info: user request is out of synch with current page/form - redisplaying":
Thu Jan 15 19:21:39: INFO Start of page POSTFORM
Thu Jan 15 19:21:39: INFO <-- Displaying page FORMDETAILS
Thu Jan 15 19:21:39: Info: user request is out of synch with current page/form - redisplaying
Thu Jan 15 19:21:39: ERROR Server Error: null
If I was to guess I would say they used a back-button or something like that? The POSTFORM page has no navigation buttons at all, only a few external links.

Thanks,
Alex
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Jan 16, 2015 9:53 am

The " Info: user request is out of synch with current page/form - redisplaying" message is shown just for info and almost certainly means that the user has used the back button and that back button support is turned on for the form. The system then attempts to re-display the requested page.

At that point something has gone wrong "ERROR Server Error: null" and there should be a full stacktrace for this error in one of your log files. It looks as if the requested page maybe doing a client API Javascript call to the server and this is failing - but I'm guessing. The stacktrace should answer the question of what is failing.

In general, the subject of the back button can be quite difficult. The problem in a nutshell is that when the user goes back to a previous page, the server is still holding all the data for the latest page, and there may be incompatibilities. There is a discussion of this in the Ebase documentation: Help Index > Browser Related Topics > Back Button.

Regards
Jon
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#3

Postby alexmcclune » Fri Jan 16, 2015 10:28 am

Cheers for that,

When the user left the "FORM_DETAILS" page they executed client side javascript/jquery to submit the form and execute the server side resources etc. On displaying the POST_FORM we expect (as developers) no more processing to be done at all.

I think I will disable the back button by setting it as "Not Supported" for the time being.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Jan 16, 2015 10:31 am

Yes that should stop this problem.
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#5

Postby alexmcclune » Fri Jan 16, 2015 11:24 am

Cheers.
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#6

Postby alexmcclune » Fri Feb 06, 2015 8:08 am

Hi again Jon,

I've been struggling with this a little. I have set the setting on our forms to "Not Supported" but I noticed we had a duplicate submission last night and it appears the user (ignored the text explaining not to use the back button...) submitted the form then went back and re-submitted it from the same session.

In the hope we can try and mitigate this I was hoping to create a global script for use on all forms that simply doesn't do anything, or alternatively takes the user to an error page rather than allowing them to resubmit their forms.

I created a basic global script with the code:

Code: Select all


var backButtonUsed = client.isBackButtonUsed&#40;&#41;;

if &#40;backButtonUsed == true&#41;&#123;
 // log error and form.gotourl error page
&#125;
I can see this sometimes works, unfortunately it isn't working on the button I would like it too...It works on the first three pages if the user navigates back to any one of them an error is displayed when the user then tries to go forward. However the final "submit" form" button doesn't work properly and I suspect the problem is again caused by the fact we use jquery to execute our submit function. Can you advise as to a way I can handle this?

My only thought just now is to have another field "is_submitted" and set it to 1 when the form is successfully submitted". Then include a check on the submit script to test the is_submitted value.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#7

Postby Jon » Fri Feb 06, 2015 11:18 am

Alex,

Something doesn't sound right here. If you've set the back button to "not supported" it shouldn't be possible for the user to use the back button to go backwards and forwards through the Ebase form pages. If they click on it, it should take them back to the link outside of the Ebase system. So it's a bit of a mystery how they managed to submit the form twice. Just for interest, is there anything stopping them just clicking the button twice - ignoring the back button?

You may well be right that it's the use of client-side code to handle the submit button that contributes to the problem - this may be bypassing our code to check for an out of sequence page. I suspect that using client.isBackButtonUsed() won't work as it relies on this same code to detect that the back button has been used.

How about this as a possible solution: when the user clicks submit, call the server and check if a submit has already been processed for this form, then show an error message. You can do this by setting a form field on the server when it processes the submit and then reading it on the client with $eb.getFieldValue("SUBMITTED").

P.S. I'm not surprised the user ignored your advice not to use the back button - sounds like normal user behaviour.

Regards
Jon
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#8

Postby Jon » Fri Feb 06, 2015 11:22 am

Alex,

Just had another thought. Maybe a simpler solution is to disable the submit button as the first thing done by your client side code i.e. before you process the request. Then however the user gets back to this page, they won't be able to click it.

Jon
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#9

Postby alexmcclune » Sat Feb 07, 2015 10:32 am

Ohh its so obvious.......
0 x


Who is online

Users browsing this forum: No registered users and 22 guests