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

Attempted to remove an unattached handler #145

Closed
vyobukhov opened this issue Oct 9, 2016 · 8 comments
Closed

Attempted to remove an unattached handler #145

vyobukhov opened this issue Oct 9, 2016 · 8 comments

Comments

@vyobukhov
Copy link

Hello,

I have two vertical collections on routes: /dialogs and /dialog/:id. The first one contains list of dialogs and the other one contains list of messages in this dialog.

Code of the first one (/dialogs):
{{#vertical-collection content=model defaultHeight=100 alwaysUseDefaultHeight=true useContentProxy=false as |item index| }} {{c-dialog model=item open="open"}} {{/vertical-collection}}

Code of the second one (/dialog/:id):
{{#vertical-collection content=messages defaultHeight=30 alwaysRemeasure=true renderFromLast=true as |item index| }} {{c-dialog-message model=item}} {{/vertical-collection}}

When I'm trying to go back from messages to dialogs (/dialogs => /dialog/1 => /dialogs) list I'm getting this error "Attempted to remove an unattached handler"

But when I'm navigating through one more route (for example /dialogs => /dialog/1 => /profile => /dialogs) everything works fine.

Is it bug? Or I'm doing something wrong?

@mszoernyi
Copy link

mszoernyi commented Nov 3, 2016

I've got a similar/same issue with two vertical-collections on one page. Doesn't seem to happen if only one is rendered at once.

For me it only happens if one of the tables is destroyed. We are setting a containerSelector which was the same for all tables but it doesn't seems to be related to this.

Debugging flow

  1. _teardownHandlers() calls removeScrollHandler(this.telescope, this._scrollHandler) first without errors
  2. _teardownHandlers() calls removeScrollHandler(Container, this._scrollAdjuster)
  3. elementCache is {top: 0, left: 0, handlers: Array[0]} - shouldn't it have at least on adjust handler?
  4. leads to the error itself

@vyobukhov maybe you can check if the debugger flow is the same for you. Given error is triggered in two different cases here and here

@runspired I'm not sure how to dig deeper?

@kylemellander
Copy link
Contributor

does it seem like it would be viable to return inside returnElementHandler if the length of the handlers is 0. This would prevent this breaking error - and it doesn't seem like it would leave any handlers orphaned.

@eriktrom
Copy link
Member

@kylemellander - yes that would fix error - but wondering @runspired's thoughts on GC perf issues - do the listeners still hold a reference that the browser engine will have to run GC cycles for? Or did ember tear them down already for us?

(have not read lib code at all, fyi) - but looking at options for new client's app that needs mobile infinite scroll - so might in future if this project seems active enough

adamjmcgrath added a commit to adamjmcgrath/smoke-and-mirrors that referenced this issue Jan 23, 2017
adamjmcgrath added a commit to adamjmcgrath/smoke-and-mirrors that referenced this issue Jan 23, 2017
@adamjmcgrath adamjmcgrath mentioned this issue Jan 23, 2017
adamjmcgrath added a commit to adamjmcgrath/smoke-and-mirrors that referenced this issue Feb 18, 2017
jon-hall added a commit to jon-hall/smoke-and-mirrors that referenced this issue Apr 5, 2017
Taken from adamjmcgrath/smoke-and-mirrors/tree/fix-tests
@runspired runspired mentioned this issue Apr 24, 2017
8 tasks
@bloodknight2010
Copy link

I got the same error. I use smoke-and-mirrors version 0.6.2.But I can't. How to solve?

@rafaelbnp
Copy link

+1

@rafaelbnp
Copy link

I'm seeing this error when running my acceptance test, it breaks all my tests afterwards. Would really appreciate some help on how to fix it.

Error: Attempted to remove an unattached handler

@eriktrom
Copy link
Member

eriktrom commented Jul 8, 2017

the repo moved, try upgrading and use https://github.com/html-next/vertical-collection

@runspired
Copy link
Collaborator

Should be fixed by updating to @html-next/vertical-collection (now re-exported by this lib)

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

7 participants