Announcement

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

    AdaptiveMenu WARN

    SmartClient Version: v13.1p_2025-03-31/AllModules Development Only (built 2025-03-31)

    Safari, Chrome, Firefox on MacOS

    Even though it seems harmless, I want to report a warning related to AdaptiveMenu that I see in my application.

    Please run this test case in the browser console (I'm using the showcase, Shiva skin and Spacious density):

    Code:
    isc.DynamicForm.create({
        ID: "exampleForm",autoDraw:false,
        width: "100%",
        fields: [
            {
                name: "username",
                title: "Username",
                type: "text",
                width: "*",
                required: true,
                defaultValue: "bob"
            },
            {
                name: "email",
                title: "Email",
                required: true,
                width: "*",
                type: "text",
                defaultValue: "bob@isomorphic.com"
            }
        ]
    });
    
    isc.AdaptiveMenu.create({
        ID: "adaptiveMenu",autoDraw:false,
        menuButtonTitle: "More...",
        align: "center",
        defaultLayoutAlign: "center",
        items: [
            {
                title: "Foo Bar 1",
                icon: "Edit"
            },
            {
                title: "Foo Bar 2",
                icon: "Edit"
            },
    
            {
                title: "Foo Bar 3",
                icon: "Edit"
            },
            {
                title: "Foo Bar 4",
                icon: "Edit"
            },
            {
                title: "Foo Bar 5",
                icon: "Cancel",
                visibleWhen: {fieldName: "exampleForm.values.username", operator: "equals", value: "bob"}
            },
            {
                title: "Foo Bar 6",
                icon: "Cancel",
                visibleWhen: {fieldName: "exampleForm.values.username", operator: "notEqual", value: "bob"}
            },
            {
                title: "Foo Bar 7",
                icon: "Close",
                enableWhen: {fieldName: "exampleForm.values.username", operator: "equals", value: "bob"}
            }
        ]
    });
    
    isc.ToolStrip.create({
        ID: "toolStrip",autoDraw:false,
        height: 32,
        width: "100%",
        layoutMargin: 0,
        defaultLayoutAlign: "center",
        members: [
            isc.IButton.create({title: "Close", icon: "Close", autoFit: true}),
            adaptiveMenu,
            isc.IButton.create({title: "Save", icon: "Save", autoFit: true})]
    });
    
    isc.Window.create({
        ID: "testWindow",autoDraw:false,
        title: isc.version,
        width:600, height:400, showFooter: true,
        items: [exampleForm],
        footerControls: [toolStrip]
    }).show()
    You'll see this WARN:

    Code:
    *17:35:50.669:WARN:FilteredList:isc_FilteredList_4 (dataSource: isc_DataSource_4, created by: undefined):addAt(): cannot add {title: "Foo Bar 6",
    icon: "Cancel",
    visibleWhen: Obj,
    getAdaptiveMenu: getAdaptiveMenu(),
    } as the ResultSet already contains this object.

    #2
    Thanks for the report, Claudio. This warning is fixed in builds starting on April 5.

    Comment


      #3
      SmartClient Version: v13.1p_2025-04-06/Enterprise Deployment (built 2025-04-06)

      The warning message is gone now, thanks a lot!

      Comment


        #4
        SmartClient Version: v13.1p_2025-05-05/AllModules Development Only (built 2025-05-05)

        Hello, I just noticed that I see this WARN, again.

        Comment


          #5
          Hello, to be more precise, I don't see the WARN when using version v13.1p_2025-04-14/Enterprise Deployment, but I do see it with v13.1p_2025-04-15/Enterprise Deployment.

          This time, however, the WARN is not harmless: I’m encountering an issue on iOS with a Window that contains the AdaptiveMenu, which triggers the WARN, in its footer (the Window won't show and the app freezes).

          Comment


            #6
            HI Claudio,

            Can you provide additional information on how to reproduce the app freeze? We do see the warning show and will fix that but want to make sure the freeze is fixed as well.

            Comment


              #7
              Hello, since the two issues seem closely related (the WARN reappears starting from the April 15 build, and at the same time the Window/freeze problem occurs), I hope that resolving the WARN will also fix the other issue. However, so far I haven't been able to reproduce the freeze in the showcase.

              Basically, I observed it on a handset (iOS), but I haven't tested on other mobile devices yet. The situation involves opening a first modal Window, and then a second modal Window on top of the first Window. The freeze happens on the show of the second one on iOS.

              Both Windows have an AdaptiveMenu in the footer. On desktop, I see the WARN when showing the first Window, but not when showing the second. On iOS handsets, I don't see the WARN when showing the first Window, but I do see it when showing the second (then the Window isn't displayed and the app freezes).

              Comment


                #8
                I'm still trying to reproduce the freeze issue, but without success.
                I'll just add that if I remove the AdaptiveMenu from the footer of the second window, the freeze issue doesn't occur.

                Comment


                  #9
                  A fix for the warning regression has been committed for builds starting on May 8. However, it doesn't appear likely that this is the culprit in a freeze. That may be related to a specific set of items, sizing and conditions. If you can pause debugging to capture the point of failure and a stack trace or better yet, reproduce it with sample code, we can take a look.

                  Comment


                    #10
                    Hello, I managed to reproduce it, please run the showcase with this custom density using the XCode simulator, Safari on iPhone 15 iOS 17.4:
                    https://www-demos.smartclient.com/sm...izeIncrease=15

                    then run this code in the browser console:
                    Code:
                    isc.Window.create({
                            title: "Test",
                            maximized:true,
                            bodyProperties: {
                                padding: 0
                            },
                            showFooter :true,
                            footerControls: [
                                isc.IButton.create({title:"Chiudi", autoFit:true, icon: "Close"}),
                                isc.AdaptiveMenu.create({
                                    align: "center",
                                    defaultLayoutAlign: "center",
                                    menuButtonTitle: "Altro...",
                                    reportVM: null,
                                    initWidget: function () {
                                        let items = [
                                            {
                                                title: "Sblocca Modifica",
                                                visibleWhen: {
                                                    _constructor: "AdvancedCriteria",
                                                    operator: "and",
                                                    criteria: [
                                                        {fieldName: "auth.roles", operator: "contains", value: "ROLE_NOT_PRESENT"}
                                                    ]
                                                },
                                                icon: "Edit"
                                            },
                                            {
                                                title: "Report PDF",
                                                icon: "View"
                                            },
                                            {
                                                title: "Report Excel",
                                                icon: "View"
                                            }
                                        ];
                                        this.setItems(items);
                                        this.Super("initWidget", arguments);
                                    }
                                }),
                                isc.IButton.create({title:"Invia", autoFit:true, icon: "Cancel"}),
                            ],
                            items: [
                            ]
                        }).show()
                    I just see this WARN:
                    Code:
                    *23:46:48.138:WARN:FilteredList:isc_FilteredList_0 (dataSource: isc_DataSource_4, created by: undefined):addAt(): cannot add {title: "Report Excel", icon: "View", getAdaptiveMenu: getAdaptiveMenu(), } as the ResultSet already contains this object.
                    at ISC_Core.js:1478:141
                    and the showcase freeze.

                    Comment


                      #11
                      SmartClient Version: v13.1p_2025-05-08/Enterprise Deployment (built 2025-05-08)

                      Hello, I no longer see the WARN in this build, but as you said, the freeze issue is still present.

                      Comment


                        #12
                        We are not able to reproduce the freeze so far. What do we need to do make the test case fail?

                        Comment


                          #13
                          Hello, I must say that for me the issue doesn’t occur 100% of the time, but it does happen most of the time.

                          I've also reproduced it on a physical device iPhone 8 running iOS 16.7.11.

                          Using the Xcode simulator, I've observed the issue on an iPhone SE and an iPhone 15 (both running iOS 17.4), and also on an iPhone SE with iOS 18.2.

                          I open the 13.1 showcase at https://www-demos.smartclient.com/sm...izeIncrease=15
                          It is *required* to use fontIncrease=4 and sizeIncrease=15

                          Then I open the Web Inspector using Safari Technology Preview, and run the code from post #10 in the console:
                          Code:
                          isc.Window.create({
                                  title: "Test",
                                  maximized:true,
                                  bodyProperties: {
                                      padding: 0
                                  },
                                  showFooter :true,
                                  footerControls: [
                                      isc.IButton.create({title:"Chiudi", autoFit:true, icon: "Close"}),
                                      isc.AdaptiveMenu.create({
                                          align: "center",
                                          defaultLayoutAlign: "center",
                                          menuButtonTitle: "Altro...",
                                          reportVM: null,
                                          initWidget: function () {
                                              let items = [
                                                  {
                                                      title: "Sblocca Modifica",
                                                      visibleWhen: {
                                                          _constructor: "AdvancedCriteria",
                                                          operator: "and",
                                                          criteria: [
                                                              {fieldName: "auth.roles", operator: "contains", value: "ROLE_NOT_PRESENT"}
                                                          ]
                                                      },
                                                      icon: "Edit"
                                                  },
                                                  {
                                                      title: "Report PDF",
                                                      icon: "View"
                                                  },
                                                  {
                                                      title: "Report Excel",
                                                      icon: "View"
                                                  }
                                              ];
                                              this.setItems(items);
                                              this.Super("initWidget", arguments);
                                          }
                                      }),
                                      isc.IButton.create({title:"Invia", autoFit:true, icon: "Cancel"}),
                                  ],
                                  items: [
                                  ]
                              }).show()
                          HTH

                          Comment

                          Working...
                          X