Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Expected behavior for Queues where one DSRequest does not pass validation

    Hi Isomorphic,

    using 5.1p:
    1. What is the expected behavior for Queues with 2 DSRequests when the 1st DSRequest requires serverside validation and this validation fails? Should the 2nd (validation-passing) DSRequest (and the transaction in total) fail?
    2. What is the expected behavior for Queues with 2 DSRequests when the 1st DSRequest only requires clientside validation and this validation fails? Should the 2nd (validation-passing) DSRequest (and the transaction in total) fail?
    In my opinion the behavior should be the same in both cases, the 2nd request should be executed successfully, because for the user, there is no difference between a DynamicForm with client-only validation and a DynamicForm with serverside validation. If you agree I can prepare a testcase showing different behavior.

    Best regards
    Blama




    #2
    The second case doesn't actually exist - we don't send a DSRequest to the server if what's going on is client-side validation.

    You may have meant something different, like perhaps the request is operationType:"validate", that is, a request that performs server-side validation, but does not attempt a save?

    Comment


      #3
      Hi Isomorphic,

      What I want to accomplish is to do validation and only save if there are no errors.
      Pseudocode:
      1. Start Queue
      2. For all changed Forms/ValuesManagers, call validation (effictively client-only validation), if it passes, save
      3. Send Queue
      My problem is that if a changed form includes a serverside-validator and only this one fails, the whole queue fails.
      I can't wait for the serverside-validator to return, because validate() does not support a Callback, so the request that will fail on the server will be in the Queue.
      In case of a clientside-only validation the form would not be saved, therefore not be in the queue, therefore the queue would succeed and only the erroneous form would not be saved.

      This is what we are already discussing here.
      The whole validate()/Callback discussion would be not necessary, if a failed validation would not cause the whole Queue to fail.
      I am not saying it should not fail, I was only asking if the observed behavior is intended.
      The more elegant solution is definitely to wait for the server validation and then save(), like suggested in the 2nd pseudo code in the linked post.

      Best regards
      Blama
      Last edited by Blama; 21 Mar 2016, 04:17. Reason: markup messed up.

      Comment


        #4
        We'll continue in the other thread since you've posted essentially the same question but with more detail there.

        Comment

        Working...
        X