Announcement

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

    DataSource loader issues after upgrade 12.1p 2022-04-20 to 2022-06-03

    Isomorphic,

    We upgraded our 12.1p pro SmartGWT libraries from 2022-04-20 to 2022-06-03 and now our application is non-functional.

    The following is showing up in the console for our datasources.

    *10:31:45.663:WARN:Log:ReferenceError: iEquals is not defined Stack from error.stack: unnamed() @ uc/sc/DataSourceLoader?dataSource=...

    Thanks

    #2
    Hi Stonebranch
    The DataSourceLoader in general is not broken in our testing so we'll need some more information to get to the bottom of this one.

    Can you share
    The DataSource (ds.xml) file in question
    The snippet of code you're using to hit it (Is this a simple script src=... referring to the URL or something else)?
    The full stack trace from the error log

    If the problem is the DataSource loader producing bad JavaScript as your message implies this may be sufficient to reproduce the problem, but if this occurs in conjunction with any specific UI we may need to also see the code that generates this UI

    Thanks
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      This is not specific to one DataSource.

      I'll collect more information, and provide you it as I collect it.

      Regards

      Comment


        #4
        Do you still have your code in place to try to add a custom operator? We would try disabling that.

        Also can we get the rest of the stack and client-side log?

        Comment


          #5
          No, none of that proof of concept code is applicable here; in this case we are taking our generally available release and applying the new smartgwt libraries.

          Click image for larger version  Name:	image_13359.png Views:	5 Size:	1.3 KB ID:	268170

          Click image for larger version  Name:	Screenshot 2022-06-10 163252.png Views:	0 Size:	2.8 KB ID:	268171

          That validOperators looks odd, shouldn't it be something like ["iEquals","iNotEqual","isNull","notNull","inSet","notInSet"]}?

          Just for reference, here are some things we do with the operators, from the code side, and from the ds.xml side.

          Regards

          Code:
          public static final OperatorId[] TEXT_OPERATORS = new OperatorId[] { OperatorId.ICONTAINS, OperatorId.ISTARTS_WITH, OperatorId.IENDS_WITH,
          OperatorId.IEQUALS, OperatorId.INOT_CONTAINS, OperatorId.INOT_STARTS_WITH, OperatorId.INOT_ENDS_WITH, OperatorId.INOT_EQUAL,
          OperatorId.IS_NULL, OperatorId.NOT_NULL, OperatorId.IN_SET, OperatorId.NOT_IN_SET, OperatorId.LESS_THAN, OperatorId.LESS_OR_EQUAL,
          OperatorId.GREATER_THAN, OperatorId.GREATER_OR_EQUAL, OperatorId.AND, OperatorId.OR, OperatorId.NOT };
          
          DataSource ds = DataSource.getDataSource(dataSourceId, someRequestTransformer, someResponseTransfomer);
          if (ds != null) {
          ...
          ds.setTypeOperators(FieldType.TEXT, TEXT_OPERATORS);
          ...
          }
          Code:
          <field name="somefield" foreignKey="someObject.primaryKey" displayField="someDisplayField" type="text">
                      <title><fmt:message key="someproperty.label"/></title>
                      <prompt><fmt:message key="someproperty.hint"/></prompt>
                      <validOperators>iEquals</validOperators>
                      <validOperators>iNotEqual</validOperators>
                      <validOperators>isNull</validOperators>
                      <validOperators>notNull</validOperators>
                      <validOperators>inSet</validOperators>
                      <validOperators>notInSet</validOperators>
          </field>
          Last edited by stonebranch2; 10 Jun 2022, 18:30.

          Comment


            #6
            As far as client side logging goes, I am not seeing much more than provided.

            *16:55:41.217:INFO:loadTime:Charts module init time: 2ms
            *16:55:41.218:DEBUG:Page:handleEvent(moduleLoaded): firing action => if(_2.moduleName=="Drawing"){isc.$135q()}
            *16:55:41.218:DEBUG:Page:handleEvent(moduleLoaded): firing action => if(_2.moduleName=="Charts"){isc.$1478()}
            *16:55:41.249:INFO:Page:Loaded skin: Light
            *16:55:41.262:INFO:fontLoading:CSS not yet loaded - deferring detection of custom font loading until CSS loaded
            *16:55:41.263:INFO:fontLoading:CSS loaded - detection of custom font loading can proceed
            *16:55:41.263:INFO:fontLoading:Requested loading of 4 custom fonts
            *16:55:41.268:INFO:fontLoading:Waiting on 4/4 fonts to load using the CSS Font API
            *16:55:41.269:INFO:fontLoading:All fonts needed have successfully loaded
            *16:55:41.284:WARN:Log:ReferenceError: iEquals is not defined
            Stack from error.stack:
            unnamed() @ uc/sc/DataSourceLoader?dataSource=system,userPreference,uploadDefinitionsFile:2:371


            Click image for larger version

Name:	Screenshot 2022-06-10 170346.png
Views:	216
Size:	5.8 KB
ID:	268174

            Comment


              #7
              There are also occurrences for other operators too, like iContains, for example.

              Comment


                #8
                From what you've shared so far it seems like when the dataSourceLoader URL is hit, it's failing to pick up the validOperators XML elements and turn them into JS.
                To verify this, can you do the following:

                - open the browser inspector / developer tools and open the Network tab
                - kick off the code that calls "getDataSource()" and watch for the request that hits the "DataSourceLoader? ..." URL
                - Look at the contents of the server response. If the "validOperators" attribute of a field is indeed just validOperators:iEquals or whatever, that's invalid JavaScript [as the iEquals isn't a quoted string or an array].

                You mention that this is happening for multiple DataSources. Presumably multiple DataSources are not actually required to hit the problem though.
                You should be able to pick any of these and confirm this is indeed the problem by hitting the dataSourceLoader url with a suffix of "?dataSource=<dsName>" and looking at the output.

                Can you confirm that this is indeed what you're seeing.
                If so - can you share the full ds.xml file with us [feel free to mail it to support@isomorphic.com if it's not appropriate to be shared on a public forum].

                We're not reproducing this issue on our end so it seems there must be something special about your dataSources.

                Thanks
                Isomorphic Software

                Comment


                  #9
                  One more question: are you seeing any warnings or other server side logs when you hit the DataSourceLoader and get a bad result which might shed light on what's happening?

                  Thanks

                  Comment


                    #10
                    No, the server side log shows no indication of anything going wrong.

                    I created a scaled down version of one of the ds.xml.

                    Code:
                    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                    <DataSource xmlns:fmt="WEB-INF/" ID="userPreference" inheritsFrom="system" serverType="generic">
                        <fmt:bundle basename="dictionary"/>
                        <fields>
                            <field name="userName" type="text" opsFkRefField="userId" canEdit="false">
                            </field>
                            <field name="userId" foreignKey="user.sysId" displayField="userName" type="text">
                                <validOperators>iEquals</validOperators>
                                <validOperators>iNotEqual</validOperators>
                                <validOperators>isNull</validOperators>
                                <validOperators>notNull</validOperators>
                                <validOperators>inSet</validOperators>
                                <validOperators>notInSet</validOperators>
                            </field>
                        </fields>
                    </DataSource>
                    Click image for larger version

Name:	Screenshot 2022-06-10 221438.png
Views:	186
Size:	7.8 KB
ID:	268179

                    Comment


                      #11
                      Ok, we figured this out. Someone tried to use the documented format for validOperators, and it didn’t work, so we fixed it:

                      https://forums.smartclient.com/forum...ile#post268106

                      It looks like you figured out an undocumented format that worked before we corrected the bug, but doesn’t now.

                      The best thing would be to switch to the documented format, but, because other people may have figured out the undocumented format you did, we do plan to make both work, but that will take a few days.

                      Note also, since basically every DataSource was broken for you, we’re guessing you probably have validOperators declarations in just about every file - you don’t need to do that. See the linked thread for how to use SimpleType so that you can share validOperators (and other field configuration).

                      Comment


                        #12
                        Hi Isomorphic,

                        Thank you for the update.

                        Please let us know when you have a build available that is backwards compatible with the format we are using. For our current maintenance release, we are limiting the scope of changes, so we will have to review the additional information you provided and consider it for a future release.

                        Thank you

                        Comment


                          #13
                          Note also, since basically every DataSource was broken for you, we’re guessing you probably have validOperators declarations in just about every file - you don’t need to do that. See the linked thread for how to use SimpleType so that you can share validOperators (and other field configuration).
                          We only use this declaration for verify specific fields, not globally for every field type. For example, foreign key fields, as shown in the example above.

                          We do not use it globally for every field.

                          Comment


                            #14
                            Understood. We'll put in code to handle the old, undocumented format right away.

                            Comment


                              #15
                              Thank you very much.

                              Comment

                              Working...
                              X