Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing SpinWheelSlot properties hangs Maqetta #3409

Closed
aerwin opened this issue Sep 18, 2012 · 7 comments
Closed

Changing SpinWheelSlot properties hangs Maqetta #3409

aerwin opened this issue Sep 18, 2012 · 7 comments

Comments

@aerwin
Copy link
Contributor

aerwin commented Sep 18, 2012

Opening against M7.0.1 for investigation...

  1. New Mobile Application
  2. Drag SpinWheel onto canvas
  3. Choose one of the SpinWheelSlot's in the SpinWheel
  4. Under widget specific properties try to change labels, labelFrom, or labelTo (maybe others) and Maqetta locks up (can't select anything else, etc.)
@aerwin
Copy link
Contributor Author

aerwin commented Sep 18, 2012

Using Chrome on Mac going to maqetta.org

@JonFerraiolo
Copy link
Member

@aerwin - could you please try again and provide extra details? I tried to reproduce and couldn't get things to hang, either locally or at maqetta.org. What exact values did you try to enter into which properties? I did see a couple of bugs, but no hangs.

@aerwin
Copy link
Contributor Author

aerwin commented Sep 18, 2012

@JonFerraiolo

Sure... guess maybe it's more specific to certain actions than I initially thought...

Here's one that consistently hangs for me...

  1. New Mobile Application
  2. Drag SpinWheel onto canvas
  3. Choose first SpinWheelSlot in the SpinWheel
  4. Under widget specific properties clear out the labels property and hit tab key to commit change

@JonFerraiolo
Copy link
Member

-> M8 @jhpedemonte. Too hard to fix for M7.0.1. We will just have to hope no users put an empty string value for SpinWheelSlot labels property.

@peller @billreed63 @doronrosenberg @jhpedemonte

Here is the reason for the hang. If an empty string is passed into SpinWheelSlot.js, I'm seeing that there is an infinite loop around line 107.

                var len = this.items.length;
                var n = Math.ceil(this.minItems / len);
                for(j = 0; j < n; j++){

If the label string is an empty string, then this.items has a length of zero,, and the `Math.ceil1 results in infinity. Takes a long time to get to reach that value.

Two possible fixes:

  • We could convince the Dojo team to put a check on len to prevent the infinity loop
  • We could (a) add a new setPropertyValue helper and/or (b) a validatePropertyValue helper and/or (c) a declarative validation string in widgets.json so that there is a way that we can prevent Maqetta users from entering an empty value.

@ghost ghost assigned jhpedemonte Sep 18, 2012
@aerwin
Copy link
Contributor Author

aerwin commented Sep 19, 2012

@JonFerraiolo

--> back to M7.0.1 for discussion

I'm finding it so easy to hit the hang (it's not just emptying out the labels attribute) that I think if we can't address this in M7.0.1 that we almost have to tell users to avoid using SpinWheel. Or, maybe until we can fix we should hide labels, labelsFrom, and labelsTo from the palette?

The most recent way I hit it:

  1. Drag SpinWheel onto mobile canvas
  2. Drag SpinWheelSlot onto SpinWheel
  3. Wanted the slot to go from 0 to 9, and labelsFrom and labelsTo are empty. Very natural to enter 0 in labelsFrom and 9 in labelsTo, but entering 0 in labelsFrom and trying to tab to labelsTo hits the hang

@aerwin
Copy link
Contributor Author

aerwin commented Sep 19, 2012

@jhpedemonte

JonFerraiolo pushed a commit that referenced this issue Sep 27, 2012
labelFrom or labelTo have empty string values.
@peller
Copy link
Member

peller commented Feb 12, 2013

filed a Dojo ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants