queue click action running multiple times for one click.

I’ve still been experiencing this problem on 10.0.15.

Still seeing it in 11.1.6

Matt and Arne-per, I’m revisiting the repro page I used in October to verify this issue in 10.0.19, and I can’t seem to reproduce the issue. My page has a queue on a UI-only model, and clicking on a queue item runs a snippet that runs a console.log(‘hello’); 

If I’m remembering right, the snippet would run multiple times, depending on which row you clicked on. I’ve tried different configurations on the page, but the snippet’s only running once per click. 

Matt, if you’re still seeing the behavior in your versions, do you have any way to spin up a sandbox or dev environment to test your affected pages in 10.0.19?

Arne-Per, are you able to provide more detail about your scenario? The screenshot is helpful, but it would be helpful to also see the queue’s action sequence and the snippet that’s running too many times. 

HI Mark,

Yes the queue interaction is ‘click’ and the action is a simple page include update

Mark,

Upgraded a dev environment to 10.0.19. Still seeing the same behavior:


Thank you for taking the time to demonstrate your scenario. Is the getAvailableFields snippet being run on pageload, or when a queue item is clicked?

Arne-Per,

In your scenario, you have a queue interaction that updates a page include, correct? When a user does this, is the issue that they’re seeing multiple copies of the page include? Is it always the same number of duplicates, or is it different depending on how far down in the queue they clicked?
Also, can you tell me what the Queue’s model is like? Is it a UI-only model, or is it attached to a Salesforce object?

Thanks. I’m looking for more details since I haven’t yet been able to reproduce the behavior in 10.0.19 or 11.1.6, and I’m hoping to find out what you and Matt Sones have in common. 

getAvailableFields runs on pageload: 

(function(skuid){<br>var $ = skuid.$;<br>$(document.body).one('pageload',function(){<br>skuid.snippet.getSnippet('getAvailableFields')();<br>});<br>})(skuid);


And it also runs when the SignatureFields model (the table’s model) is saved.

It may be that everywhere I’ve experienced this it’s on a page that’s being included on another page? Perhaps try including your test page in anther page and see what happens?

Mark- no matter where in queue. It is the number of clicks that causes the commensurate number page include instances

So here is a reduced example. and video of original. In the small test the addEventListener is added, It could be that the included page is so small that it doesn’t allow for the the listener to be updated which is why it infact works with larger included page. Thanks for continuing to look at it.

condition.valueChanged {{Name}}: {{Make __c}}:{{Description_from_DIS__ c}} {{Model.label}} This is a Very sparse test var params = arguments[0], $ = skuid.$; .bang2 field { text-align: center; } .nx-actionselect-dropdown-item { padding-right:50px; }

______

{{Name}} we are ttest {{Model.label}}

Arne-Per,

Thank you for providing your test pages. I’m not seeing any strange behavior when trying these two test pages, unfortunately. I also don’t see any eventlisteners or error messages about them. In your Queue’s display template, can you try changing this

{{Name}}:
{{Make__c}}:{{Description_from_DIS__c}}

to this:
{{{Name}}}:
{{{Make__c}}}:{{{Description_from_DIS__c}}}

and let me know if that makes a difference?

Is there any script happening in the Queue actions? 


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?

Mark, I’ll try but the picture in the post is the error I get using the sample pages. No script happening . Why the {{{}}}}?

I didn’t add event listener. That was error that was generated on multiple . Mistype . Sorry for confusion.

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. 

Thanks Mark, In my page I have a UI block.

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.


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>&amp;lt;ol&amp;gt;Steps to reproduce issue:
    &amp;lt;li&amp;gt;Open browser JS console&#46;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Click button to "Add a row to UI model" a few times&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Click each newly created row in the Queue&#46; An Interaction will run a snippet that creates a console&#46;log()&#46;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Observe console for how many console logs are created&amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;
Expected Behavior: One console log should be present for each item clicked on queue
observed Behavior: Several console logs are being created&#46; 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)&#46; 
The behavior is the same whether the model is a UI model or a standard Salesforce object model&#46; </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&#46;log("log a click");</jsitem>
        </javascript>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>

Mark,

Thanks for continuing to follow through.
Yes, it does appear to be two distinct issues that are surfacing in similar ways.