Announcement

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

    Strange issue where the request data is different in browser and server

    Hi Isomorphic,

    please see these logs for an add request from BatchUploader (v10.1p_2016-11-08).
    Somehow an attribute gets lost between the browser request and the 1st time I can set a breakpoint on the server:

    Browser request Developer Console:
    Code:
    {
        dataSource:"V_LEADBATCHUPDATE__36__2016_11_10_03_18_03",
        operationType:"add",
        data:{
            STATUS_STATUSDATE:"2016-11-15T23:00:00.000",
            STATUS_STATUSCOMMENT:"Alles OK, verschieben",
            MD_SOURCEUID:"FOLLOWUP-1",
    [B]        STATUS_SHORTNAME:"resubmission",[/B]
            STATUS_IMPTRANS_LOOKUP_EXTNAME:"WV"
        },
        textMatchStyle:"exact",
        willHandleError:true,
        showPrompt:true,
        oldValues:{
            STATUS_STATUSDATE:"2016-11-15T23:00:00.000",
            STATUS_STATUSCOMMENT:"Alles OK, verschieben",
            MD_SOURCEUID:"FOLLOWUP-1",
            STATUS_SHORTNAME:"resubmission",
            STATUS_IMPTRANS_LOOKUP_EXTNAME:"WV"
        },
        requestId:"V_LEADBATCHUPDATE__36__2016_11_10_03_18_03$62712",
        fallbackToEval:false,
        lastClientEventThreadCode:"MUP3",
        bypassCache:true,
        dataProtocol:"getParams"
    }
    Browser request Browser network tab (formatted):
    Code:
    <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object">
        <transactionNum xsi:type="xsd:long">12</transactionNum>
        <operations xsi:type="xsd:List">
            <elem xsi:type="xsd:Object">
                <values xsi:type="xsd:Object">
                    <STATUS_STATUSDATE xsi:type="xsd:datetime">2016-11-15T23:00:00.000</STATUS_STATUSDATE>
                    <STATUS_STATUSCOMMENT>Alles OK, verschieben</STATUS_STATUSCOMMENT>
                    <MD_SOURCEUID>FOLLOWUP-1</MD_SOURCEUID>
    [B]                <STATUS_SHORTNAME>resubmission</STATUS_SHORTNAME>[/B]
                    <STATUS_IMPTRANS_LOOKUP_EXTNAME>WV</STATUS_IMPTRANS_LOOKUP_EXTNAME>
                </values>
                <operationConfig xsi:type="xsd:Object">
                    <dataSource>V_LEADBATCHUPDATE__36__2016_11_10_03_18_03</dataSource>
                    <repo xsi:nil="true" />
                    <operationType>add</operationType>
                    <textMatchStyle>exact</textMatchStyle>
                </operationConfig>
                <appID>builtinApplication</appID>
                <operation>V_LEADBATCHUPDATE__36__2016_11_10_03_18_03_add</operation>
                <oldValues xsi:type="xsd:Object">
                    <STATUS_STATUSDATE xsi:type="xsd:datetime">2016-11-15T23:00:00.000</STATUS_STATUSDATE>
                    <STATUS_STATUSCOMMENT>Alles OK, verschieben</STATUS_STATUSCOMMENT>
                    <MD_SOURCEUID>FOLLOWUP-1</MD_SOURCEUID>
                    <STATUS_SHORTNAME>resubmission</STATUS_SHORTNAME>
                    <STATUS_IMPTRANS_LOOKUP_EXTNAME>WV</STATUS_IMPTRANS_LOOKUP_EXTNAME>
                </oldValues>
            </elem>
        </operations>
    </transaction>
    Server log:
    Code:
    === 2016-11-11 23:31:51,277 [ec-4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        values:{
            STATUS_STATUSDATE:new Date(1479250800000),
            STATUS_STATUSCOMMENT:"Alles OK, verschieben",
            MD_SOURCEUID:"FOLLOWUP-1",
    [B]       STATUS_SHORTNAME:"resubmission",[/B]
            STATUS_IMPTRANS_LOOKUP_EXTNAME:"WV"
        },
        operationConfig:{
            dataSource:"V_LEADBATCHUPDATE__36__2016_11_10_03_18_03",
            repo:null,
            operationType:"add",
            textMatchStyle:"exact"
        },
        appID:"builtinApplication",
        operation:"V_LEADBATCHUPDATE__36__2016_11_10_03_18_03_add",
        oldValues:{
            STATUS_STATUSDATE:new Date(1479250800000),
            STATUS_STATUSCOMMENT:"Alles OK, verschieben",
            MD_SOURCEUID:"FOLLOWUP-1",
            STATUS_SHORTNAME:"resubmission",
            STATUS_IMPTRANS_LOOKUP_EXTNAME:"WV"
        },
        criteria:{
        }
    }
    === 2016-11-11 23:31:51,277 [ec-4] INFO  LMSIDACall - Performing 1 operation(s)
    === 2016-11-11 23:31:51,277 [ec-4] DEBUG SQLDataSource - DataSource 3196 acquired SQLDriver instance 1238298750 during initialization
    === 2016-11-11 23:31:51,278 [ec-4] DEBUG SQLDataSource - DataSource 3197 acquired SQLDriver instance 1172939677 during initialization
    === 2016-11-11 23:31:51,278 [ec-4] DEBUG SQLDataSource - DataSource 3198 acquired SQLDriver instance 831213388 during initialization
    ...
    ...
    ...
    Eclipse debug on Browser request Browser network tab (formatted):
    This is the class:
    Code:
    public class V_LEADBATCHUPDATE {
    
    public DSResponse updateLead(DSRequest dsRequest, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
    throws Exception {
    @SuppressWarnings("unchecked")
    Map<String, Object> data = (Map<String, Object>) dsRequest.getValues();​
    ...
    ...
    ...
    This is what I get for dsRequest.getValues() in Eclipse expression tab:
    {STATUS_STATUSDATE=Wed Nov 16 00:00:00 CET 2016, STATUS_STATUSCOMMENT=Alles OK, verschieben, MD_SOURCEUID=FOLLOWUP-1, STATUS_IMPTRANS_LOOKUP_EXTNAME=WV}
    Please note that STATUS_SHORTNAME is missing there.



    I have absolutely no idea what could be the reason for this. Small changes to the .ds.xml did not change anything.
    The STATUS_SHORTNAME field is one with importStrategy="display" but I have this also for another field where this problem does not exist.
    Server restarts, new compile and deploy etc did not lead to any change.

    Do you have any pointer for me how I can debug this very strange effect or even better what might be causing this?

    Thank you & Best regards
    Blama

    #2
    Is STATUS_SHORTNAME declared in your DS? If not, it would be dropped at some phase.

    Do you have a custom servlet, servlet filter, custom DataSource or anything else that might run before your DMI?

    Comment


      #3
      Hi Isomorphic,

      thanks for the fast answer.
      Yes, it is defined in the DS and I did set breakpoints on all custom DataSource methods - the first one hit already shows the issue.
      I do not have custom servlets, servlet filters.

      It get's stranger, but perhaps this does help you helping me:
      I hovered though dsRequest in Eclipse and found this interesting:

      dsRequest.requestData:
      Code:
      {  
         values=   [  
            {  
               STATUS_STATUSDATE=Sat Sep 10 00:00:00         CEST 2016,
               STATUS_STATUSCOMMENT=OK,
               MD_SOURCEUID=L-000770,
               STATUS_IMPTRANS_LOOKUP_EXTNAME=CLOSED,
               STATUS_WONLOST_ID=12,
               STATUS_POTREV_PROJECT=100,
               WONLOST_IMPTRAN_LOOKUP_EXTNAME=Gewonnen
            }
         ],
         operationConfig=   {  
            dataSource=V_LEADBATCHUPDATE__36__2016_11_10_03_18_03,
            repo=null,
            operationType=add,
            textMatchStyle=exact
         },
         appID=builtinApplication,
         operation=V_LEADBATCHUPDATE__36__2016_11_10_03_18_03_add,
         oldValues=   {  
            STATUS_STATUSDATE=Sat Sep 10 00:00:00      CEST 2016,
            STATUS_STATUSCOMMENT=OK,
            MD_SOURCEUID=L-000770,
            STATUS_SHORTNAME=closed,
            STATUS_IMPTRANS_LOOKUP_EXTNAME=CLOSED,
            STATUS_WONLOST_ID=12,
            STATUS_POTREV_PROJECT=100,
            WONLOST_IMPTRAN_LOOKUP_EXTNAME=Gewonnen
         },
         criteria=   {  
            STATUS_STATUSDATE=Sat Sep 10 00:00:00      CEST 2016,
            STATUS_STATUSCOMMENT=OK,
            MD_SOURCEUID=L-000770,
            STATUS_SHORTNAME=closed,
            STATUS_IMPTRANS_LOOKUP_EXTNAME=CLOSED,
            STATUS_WONLOST_ID=12,
            STATUS_POTREV_PROJECT=100,
            WONLOST_IMPTRAN_LOOKUP_EXTNAME=Gewonnen
         },
         _unvalidatedValues=   {  
            STATUS_STATUSDATE=Sat Sep 10 00:00:00      CEST 2016,
            STATUS_STATUSCOMMENT=OK,
            MD_SOURCEUID=L-000770,
            STATUS_SHORTNAME=closed,
            STATUS_IMPTRANS_LOOKUP_EXTNAME=CLOSED,
            STATUS_WONLOST_ID=12,
            STATUS_POTREV_PROJECT=100,
            WONLOST_IMPTRAN_LOOKUP_EXTNAME=Gewonnen
         }
      }
      What might be a reason that the field is in oldValues, but not in values?

      Thank you & Best regards
      Blama

      Comment


        #4
        That would generally mean that the field is unchanged and just being provided to the server in order for concurrent change detection to occur. But you've already showed it arriving at the server, along with several other fields that are repeated in both values and oldValues, so that doesn't help as an explanation.

        Do you have any declarative security settings on this field? If the current user is not allowed to edit it, it would be removed.

        If that's not it - look closely at the field, is there any difference between its declaration and other fields that are remaining in dsRequest.values?

        Comment


          #5
          Hi Isomorphic,

          using oldValues, instead of in values solves the problem for me, but I still don't know why my field is not in values.
          I'll try to investigate, but if you have pointers, they are very welcome.

          Best regards
          Blama

          Comment


            #6
            FYI: Last post was before reading your post #4.

            Comment


              #7
              Hi Isomorphic,

              these are the field definitions, only thing special is that
              • STATUS_SHORTNAME and STATUS_WONLOST_ID are importStrategy="display"-fields, but the data STATUS_WONLOST_ID is in values.
              • Difference: STATUS_SHORTNAME is text and STATUS_WONLOST_ID is integer, both do not have a type definition (according to your sample. Giving a type does not change anything, I already tried that)
              • Some minor validator differences between the two.
              Code:
                      <field name="MD_SOURCEUID" uploadFieldName="QuellID" length="50" type="text" escapeHTML="true">
                          <title><fmt:message key="leadIDSource" /></title>
                          <validators>
                              <validator type="required">
                                  <errorMessage><fmt:message key="validatorSourceUIDRequired" /></errorMessage>
                              </validator>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
              
                      <field name="STATUS_SHORTNAME" importStrategy="display" uploadFieldName="Statusname" displayField="STATUS_IMPTRANS_LOOKUP_EXTNAME"
                          foreignKey="T_STATUS_IMPORTTRANSLATION_LOOKUP.STATUSNAME">
                          <title><fmt:message key="newStatus" /></title>
                          <validators>
                              <validator type="required">
                                  <errorMessage><fmt:message key="validatorStatusnameRequired" /></errorMessage>
                              </validator>
                              <validator type="hasRelatedRecord">
                                  <errorMessage><fmt:message key="validatorStatusnameHasRelatedRecord" /></errorMessage>
                              </validator>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
                      <field name="STATUS_IMPTRANS_LOOKUP_EXTNAME" includeFrom="T_STATUS_IMPORTTRANSLATION_LOOKUP.EXTERNALNAME" includeVia="STATUS_SHORTNAME" />
              
                      <field name="STATUS_STATUSCOMMENT" uploadFieldName="Statuscomment" length="2000" type="text" escapeHTML="true">
                          <title><fmt:message key="statusComment" /></title>
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
              
                      <field name="STATUS_STATUSDATE" uploadFieldName="Statusdate" type="datetime">
                          <title><fmt:message key="statusDate" /></title>
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
              
                      <field name="STATUS_WONLOST_ID" importStrategy="display" uploadFieldName="WonlostID" displayField="WONLOST_IMPTRAN_LOOKUP_EXTNAME"
                          foreignKey="T_WONLOST_IMPORTTRANSLATION_LOOKUP.WONLOST_ID" hidden="true">
                          <title><fmt:message key="wonLost" /></title>
                          <validators>
                              <validator type="hasRelatedRecord" />
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
              
                          </validators>
                      </field>
                      <field name="WONLOST_IMPTRAN_LOOKUP_EXTNAME" includeFrom="T_WONLOST_IMPORTTRANSLATION_LOOKUP.EXTERNALNAME" includeVia="STATUS_WONLOST_ID" />
              
                      <field name="STATUS_POTREV_COMPANY" uploadFieldName="PotrevCompany" type="integer">
                          <title><fmt:message key="revenueCompany" /></title>
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
                      <field name="STATUS_POTREV_PROJECT" uploadFieldName="PotrevProject" type="integer">
                          <title><fmt:message key="revenueProject" /></title>
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
                      <field name="STATUS_CUSTOM1" uploadFieldName="Custom1" length="100" type="text" escapeHTML="true">
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
                      <field name="STATUS_CUSTOM2" uploadFieldName="Custom2" length="100" type="text" escapeHTML="true">
                          <validators>
                              <validator type="serverCustom">
                                  <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorTrue" />
                              </validator>
                          </validators>
                      </field>
              Still I don't see a reason for different behavior.

              Best regards
              Blama

              Comment


                #8
                Well, it seems that it is still not enough information. Based on what you've showed us issue is not reproduced yet. Are you sure nothing extra is affecting this? We'd appreciate if you could try reproduce the issue yourself with a standalone test case. A complete sample would showcase the issue more clearly, besides in the process of creating one you may notice something special by yourself. Thank you!

                Comment


                  #9
                  Hi Isomorphic,

                  as I don't know the reason for this behavior but the behavior is reproducable, I'll try to debug though the request handling to see when values changes.
                  I already tried reproducing in a testcase, but this did not show the effect.

                  I'll let you know if I hit something.

                  Best regards
                  Blama

                  Comment

                  Working...
                  X