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

Application test times out when two vertical collections share a containerSelector #320

Open
steveszc opened this issue May 14, 2020 · 4 comments · May be fixed by #327
Open

Application test times out when two vertical collections share a containerSelector #320

steveszc opened this issue May 14, 2020 · 4 comments · May be fixed by #327

Comments

@steveszc
Copy link

Minimal reproduction repo: https://github.com/steveszc/vertical-collection-shared-container-reproduction

When a route template contains two vertical-collections that share a common containerSelector (ex a scrollable body) a test that visits that route will timeout on the await visit(). The vertical-collections work as expected when using the app, however.

@steveszc
Copy link
Author

Maybe related: html-next/ember-raf-scheduler#5

@steveszc
Copy link
Author

Related: #197

@steveszc
Copy link
Author

steveszc commented May 14, 2020

I spent some time debugging this with some teammates. We were able to identify the root cause of this issue, which is a faulty piece of conditional logic inside the scroll handler util.
https://github.com/html-next/vertical-collection/blob/master/addon/-private/data-view/utils/scroll-handler.js#L53

When passive event listeners are supported, and two vertical-collection instances share the same container element, then the first vc instance adds a passive event listener, but the second vc
instance starts polling for the event.

We only want to add the event listener once and want to avoid polling altogether when passive event listeners are supported.

Starting the polling pushed an extra job into the ember-raf-scheduler which was never
removed. This caused ember-raf-scheduler's testWaiter to hang indefinitely.

I'll plan to submit a PR with the fix and a test in the next week or two.

@ro0gr ro0gr linked a pull request Feb 8, 2021 that will close this issue
@MariannaAtPlay
Copy link

Hello!
Are there any plans to fix this issue? We are running into this as well!
Thank you @steveszc for figuring out the root cause.

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

Successfully merging a pull request may close this issue.

2 participants