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

?fuzzPointers=2 error: "Cannot drag tip when not on graph" #271

Closed
jessegreenberg opened this issue Nov 19, 2020 · 7 comments
Closed

?fuzzPointers=2 error: "Cannot drag tip when not on graph" #271

jessegreenberg opened this issue Nov 19, 2020 · 7 comments

Comments

@jessegreenberg
Copy link
Contributor

From phetsims/aqua#106, this assertion is thrown when fuzzing with ?fuzzPointers=2.

Cannot drag tip when not on graph.

It didn't happen right away, I didn't encounter this until fuzzing the sim for about 45 seconds. Assigning to the responsible dev for this repo.

@pixelzoom
Copy link
Contributor

@jessegreenberg I doubt that anything would fail with ?fuzzPointers=2, because that doesn't enable assertions. Please provide the full set of query parameters for the test, and indicate whether you were testing built or unbuilt.

@jessegreenberg
Copy link
Contributor Author

I am seeing this with brand=phet&ea&fuzz&fuzzPointers=2, in the unbuilt sim.

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 19, 2020

In phetsims/aqua#106 (comment), @jessegreenberg reported:

Here is the new list after fuzzing for one minute per sim:
...

  • vector-addition: Uncaught Error: Assertion failed: Cannot drag tip when not on graph, ?fuzzPointers=2 error: "Cannot drag tip when not on graph" #271
  • vector-addition: Assertion failed: reentry detected, value=Vector2(-63.200000000000045, 111.4), oldValue=Vector2(116.00000000000001, -87.00000000000001)
    Error: Assertion failed: reentry detected, value=Vector2(-63.200000000000045, 111.4), oldValue=Vector2(116.00000000000001, -87.00000000000001)

I don't see a GitHub issue for the "reentry detected" error. @jessegreenberg did that occur as part of the same test as the "Cannot drag tip" error? If so, did it appear before or after in the stack trace?

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 19, 2020

Reproduced in working copy with brand=phet&ea&fuzz&fuzzPointers=2, stack traces below. The "reentry detected" error occurs after the "Cannot drag tip" error. The second error is likely symptomatic of the first error.

assert.js:22 Uncaught Error: Assertion failed: Cannot drag tip when not on graph
    at window.assertions.assertFunction (assert.js:22)
    at VectorNode.updateTipPosition (VectorNode.js:362)
    at tipListener (VectorNode.js:228)
    at TinyEmitter.emit (TinyEmitter.js:71)
    at Vector2Property._notifyListeners (Property.js:280)
    at Vector2Property.set (Property.js:178)
    at Vector2Property.set value [as value] (Property.js:350)
    at DragListener.reposition (DragListener.js:625)
    at DragListener.js:294
    at DragListener.onPress (PressListener.js:601)

assert.js:22 Uncaught Error: Assertion failed: reentry detected, value=Vector2(15.77426636568849, -92.23702031602707), oldValue=Vector2(-100.12641083521441, -48.86004514672685)
    at window.assertions.assertFunction (assert.js:22)
    at Vector2Property._notifyListeners (Property.js:277)
    at Vector2Property.set (Property.js:178)
    at Vector2Property.set value [as value] (Property.js:350)
    at DragListener.reposition (DragListener.js:625)
    at DragListener._dragAction.Action.parameters.name (DragListener.js:241)
    at Action.execute (Action.js:225)
    at DragListener.drag (DragListener.js:363)
    at DragListener.pointerMove (PressListener.js:790)
    at Input.dispatchToListeners (Input.js:1822)

@pixelzoom
Copy link
Contributor

pixelzoom commented Feb 4, 2021

As of 2/3/21, multi-touch fuzzing has been enabled in CT, see phetsims/aqua#106 and phetsims/perennial@e10047f. So this error is now occurring in CT.

@pixelzoom
Copy link
Contributor

pixelzoom commented Feb 8, 2021

To reproduce manually on an iPad:

  1. Run the sim on a touch device with ?ea
  2. Go to the "Explore 2D" screen
  3. With one finger, drag a⃗ out of the toolbox, but do not put it on the graph.
  4. With another finger, try to drag the tip of a⃗. This will cause the exception.

pixelzoom added a commit that referenced this issue Feb 8, 2021
@pixelzoom
Copy link
Contributor

Since there's no harm in allowing the user to drag the vector's tip when the vector is not on the graph, I simply removed the problematic assertion in the commit above. Tested on iPad6 with iOS 14.4 and mobile Safari.

Since this problem is very rarely encountered in CT, I'm going to go ahead and close this issue. If for some reason it resurfaces, we can reopen.

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

2 participants