[ 
https://issues.apache.org/jira/browse/TAP5-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2037.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.4
         Assignee: Howard M. Lewis Ship
    
> ValidationTracker/Flash persistence race condition with AJAX
> ------------------------------------------------------------
>
>                 Key: TAP5-2037
>                 URL: https://issues.apache.org/jira/browse/TAP5-2037
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Jiri Tousek
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.4
>
>
> I have a form with a field validated using an AJAX request on blur, both form 
> and AJAX requests go to the same page. Sometimes when I submit an invalid 
> form with the AJAX-validated field filled as last, the form will return with 
> no values and no errors shown (should return with last values and validation 
> errors above).
> I tracked the issue down to the form's ValidatorTracker in form re-display 
> request being a different object than the one that I store validation errors 
> in. I have no conclusive proof but I believe what happens is that a race 
> condition occurs between the submit - redirect back to form logic and the 
> AJAX field validation (the AJAX validation is fired the same instance as form 
> submit since it's the last field of the form). The form's validation tracker 
> is by default taken from the defaultValidationTracker property which has 
> PersistenceConstants.FLASH (i.e. stored until next request). I think that the 
> cause of ValidationTracker not being the same in re-display and in submit 
> request might be the AJAX validation request (or its critical part) getting 
> in between the two requests used for form submission and re-display, like 
> this:
> - form submit (creates a ValidationTracker and stores errors in it)
> - AJAX validation request ("eats up" the ValidationTracker's lifetime of 
> "until next request")
> - form re-display request (creates a new ValidationTracker with no errors in 
> it)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to