queue click action running multiple times for one click.

  • 1
  • Problem
  • Updated 7 months ago
  • Solved
Hi Skuid.

I have a queue component that is running it's click action multiple times.



Help?

I have no actions on any of the models.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
  • frustrated!

Posted 1 year ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Oh, and I'm on 9.5.14.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
There are 6 rows in the model.

Clicking on item X runs the click action Y times:
X   Y
1   7
2   6
3   5
4   4
5   3
6   2
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I just started having this happen:
I have Nav components that open a URL in a new browser window. Now when I click them, it opens 3 browser windows in chrome.
I did not recently update Skuid. I ha s been running 10.0.5 for a while.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Perhaps this is a chrome problem?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Raymond, is this happening across the board for nav components that open URLs in a new window? 
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I think it is a coincidence. I think it is my track pad giving me problems. It is happening on multiple sites. Just happened to start at the same time as Matt’s problem. Disregard. Thanks!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
another one of those times a software issue turns out to be a hardware issue... ;)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Matt,

I have been able to use the XML below to reproduce the behavior you're describing, but only when the model is a UI-only model - using a model on Account, the Queue running the snippet works as expected. You can use the table to add rows to the UI only model, then click one of the queue items to see the console log.

I also added a button that will adopt records from a non un-only model (in this case, the Account model) into the ui-only model. If you do this, then click on a queue item, the issue doesn't happen. It seems like because the UI-only rows are only given the fields we choose to create for them, there may be some metadata missing that the Queue uses for context. 

I will continue researching this, and will let you know what I find. <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">    <models>
            <fields>
                <field id="Id"/>
                <field id="Name"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
        <model id="UI" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true">
            <fields>
                <field id="Name" displaytype="TEXT" label="Name"/>
                <field id="Id" displaytype="UUID" label="Id" ogdisplaytype="TEXT"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <buttonset model="UI" uniqueid="sk-s67UV-252">
            <buttons>
                <button type="multi" label="Adopt account rows into UI model" uniqueid="sk-s67kH-256">
                    <actions>
                        <action type="adoptRows" sourcemodel="Acc" targetmodel="UI" affectedrows="all"/>
                    </actions>
                </button>
            </buttons>
        </buttonset>
        <queue model="UI" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-s423n-94">
            <rendertemplate>{{Name}}</rendertemplate>
            <interactions>
                <interaction type="tap">
                    <action type="custom" snippet="newSnippet"/>
                </interaction>
            </interactions>
        </queue>
        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="UI" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-s549s-209">
            <fields>
                <field id="Name" hideable="true" uniqueid="fi-s55NV-223"/>
                <field id="Id" hideable="true" uniqueid="fi-s6huc-278"/>
            </fields>
            <rowactions>
                <action type="edit"/>
                <action type="delete"/>
            </rowactions>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
            </massactions>
            <views>
                <view type="standard"/>
            </views>
        </skootable>
    </components>
    <resources>
        <labels/>
        <javascript>
            <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">var params = arguments[0],
$ = skuid.$;
console.log(arguments);</jsitem>
        </javascript>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
  
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Matt, I wanted to let you know that we have identified this as a product issue, and it's currently being worked on. I'm hoping a fix for this will be available soon, but I don't have an ETA yet. Thank you for taking the time to demonstrate the issue. 
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Matt, I did try your suggestion, but still haven't seen the behavior you're showing. I'm wondering if there's something in your script that's operating more times than you're expecting. Have you tried to reproduce the issue with a very simple console.log, or something like that?
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
Mark, I'll try but the picture in the post is the error I get using the sample pages. No script happening . Why the {{{}}}}?
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
I didn't add event listener. That was error that was generated on multiple . Mistype . Sorry for confusion.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Arne-Per, I am seeing the event listener error when I click multiple queue items quickly. I think it's happening because the page include component isn't ready for the input. I'd recommend blocking the UI while the page include loads, so users won't be able to click again until the included page has loaded. 
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
Thanks Mark, In my page I have a UI block.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Mark,

Here's a couple examples with just a console.log() as the queue click action. In both examples, the queues model is created with javascript on pageload. In the first example, it is a ui-only model. In the second example, it is a model on a custom salesforce object, with two newly created and unsaved rows.

Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Thank you both for your patience.

Matt, I now see this issue happening in the latest maintenance release of 10.0.x ( due out shortly), but in Millau releases like 11.0.8 and 11.1.6, the snippet is only being called once per click (i.e. working as expected). We will continue investigating this issue in the 10.0.x branch.

Arne-Per, I believe this means your issue isn't related to the one that's surfaced in this email thread, even though it looks quite similar. Would you be able to set up a new post capturing the current status of that issue, and linking to it here? 

Below is the XML I used to reproduce this issue, in case it's useful:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="UI" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true">
            <fields>
                <field id="Name" displaytype="TEXT" label="Name" defaultvaluetype="fieldvalue" defaultValue="default name"/>
                <field id="Id" displaytype="UUID" label="Id" ogdisplaytype="TEXT"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
        <model id="Acc" limit="20" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Account">
            <fields>
                <field id="Id"/>
                <field id="Name"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <template multiple="false" uniqueid="sk-14kMfe-210">
            <contents>&lt;ol&gt;Steps to reproduce issue:
    &lt;li&gt;Open browser JS console.&lt;/li&gt;
    &lt;li&gt;Click button to "Add a row to UI model" a few times&lt;/li&gt;
    &lt;li&gt;Click each newly created row in the Queue. An Interaction will run a snippet that creates a console.log().&lt;/li&gt;
    &lt;li&gt;Observe console for how many console logs are created&lt;/li&gt;
&lt;/ol&gt;
Expected Behavior: One console log should be present for each item clicked on queue
observed Behavior: Several console logs are being created. This means the script is running multiple times for each click (the lower on the list the item is, the fewer # of times the script is called). 
The behavior is the same whether the model is a UI model or a standard Salesforce object model. </contents>
        </template>
        <grid uniqueid="sk-14kltc-257">
            <divisions>
                <division behavior="flex" minwidth="100px" ratio="1">
                    <components>
                        <buttonset model="UI" uniqueid="sk-s67UV-252">
                            <buttons>
                                <button type="multi" label="Add a row to UI model" uniqueid="sk-14gpw_-151">
                                    <actions>
                                        <action type="createRow" model="UI" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                            <defaults/>
                                        </action>
                                    </actions>
                                </button>
                            </buttons>
                        </buttonset>
                        <queue model="UI" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-s423n-94" title="UI Model">
                            <rendertemplate> {{Id}} {{Name}}</rendertemplate>
                            <interactions>
                                <interaction type="tap">
                                    <action type="custom" snippet="newSnippet"/>
                                </interaction>
                            </interactions>
                        </queue>
                    </components>
                </division>
                <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
                    <components>
                        <buttonset model="Acc" uniqueid="sk-14krWh-272">
                            <buttons>
                                <button type="multi" label="Add row to Account model" uniqueid="sk-14krs6-275">
                                    <actions>
                                        <action type="createRow" model="Acc" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                            <models>
                                                <model>Acc</model>
                                            </models>
                                        </action>
                                    </actions>
                                </button>
                            </buttons>
                        </buttonset>
                        <queue model="Acc" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-14khhJ-250" title="Account Model">
                            <rendertemplate>{{Name}} {{Id}}</rendertemplate>
                            <interactions>
                                <interaction type="tap">
                                    <action type="custom" querystring="id={{Id}}" snippet="newSnippet"/>
                                </interaction>
                            </interactions>
                        </queue>
                    </components>
                </division>
            </divisions>
            <styles>
                <styleitem type="background" bgtype="none"/>
            </styles>
        </grid>
    </components>
    <resources>
        <labels/>
        <javascript>
            <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">console.log("log a click");</jsitem>
        </javascript>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>

       
(Edited)
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
will do. I had started one a while back https://community.skuid.com/skuid/topics/multiple-clicks-on-queue-item-causes-multiple-instances-of-... but I will  use your code and see what happens!
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
Running 11.1.6 the shared code only runs ones click.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Mark,

Thanks for continuing to follow through.
Yes, it does appear to be two distinct issues that are surfacing in similar ways.
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,336 Points 1k badge 2x thumb
Sorry to have distracted to have piggybacked on your thread. (I still am learning a lot though so, I appreciate it).
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
No worries! The more the merrier.
Photo of Khamla Phimmachack

Khamla Phimmachack, Official Rep

  • 1,536 Points 1k badge 2x thumb
Hi Matt,

Thank you for your patience! Skuid has fixed this issue in the Brooklyn 10.0.21 release which is now available on the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading.
(Edited)