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

Endless loop observed in some situations #11

Open
LeeGDavis opened this issue Jul 31, 2014 · 3 comments
Open

Endless loop observed in some situations #11

LeeGDavis opened this issue Jul 31, 2014 · 3 comments

Comments

@LeeGDavis
Copy link

I'm working on an application that uses Backbone at its core and we are using whenlive to determine when views and subviews are in the dom.
I haven't nailed down the exact cause, but have these observations:
Within the mutationobserver callback the mutations.length continues to grow by 4 times the previous. For example; 70, 288, 1152, 4608, 18432, 73728, .... Each subsequent complete iteration jumps to the next magnitude of 4.

I don't have a simple example to point to, but obviously curious if this is a bug or what circumstances would cause such a scenario? This was not an issue under version 2.0.5, however under 2.0.5 issues of never showing an element as in dom or firing the whenlive callback presented themselves.

OS: Windows 7x64
Whenlive: 3.0.0
Chrome: 36.0.1985.125 m

@LeeGDavis
Copy link
Author

I believe I understand the situation, but not a solution at this point. It appears that when whenlive is called on nested items. While sometimes this causes endless loops other times elements never trigger the callback. I have not been able to reproduce the endless loop with a simple example, but the following fiddle fails to trigger the callback to element C.

http://jsfiddle.net/ldavis/r6LjM/

Scenario:
Calling whenlive on the following elements:

  • A
  • B
  • B2
  • C

Operations:

  • B2 attached to B
  • A attached to C
  • B attached to C
  • C attached to the dom

@LeeGDavis
Copy link
Author

I think this is likely related to jquery 2.x update (with the use of jquery migrate) and .selector support. Removing these references and the supporting logic resolves the problem.

@tkambler
Copy link
Owner

tkambler commented Aug 1, 2014

Thank you for the status update, Lee. I'm going to leave this issue open for the moment, in hopes of visiting it soon to figure out a better resolution to the 2.x .selection support issue you mentioned.

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

No branches or pull requests

2 participants