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

onTableResize is called after test teardown #143

Open
steveszc opened this issue Feb 10, 2023 · 4 comments
Open

onTableResize is called after test teardown #143

steveszc opened this issue Feb 10, 2023 · 4 comments

Comments

@steveszc
Copy link

steveszc commented Feb 10, 2023

I've observed that in certain acceptance test scenarios that I don't fully understand yet, ember-headless-table's resizeObservers can trigger onTableResize after the test has been finished and the app has been torn down.

This redacted screen shot was captured on an uncaught error in an acceptance test.
The stack trace shows an error originating from a controller property that is being re-evaluated after the controller is destroyed, and shows the trace originating back to onTableResize which leads to the rowSelection plugin being re-evaluated, which re-evaluates our controller getter.
The anonymous call at the root of the stack trace references the ResizeObserver callback here: https://github.com/CrowdStrike/ember-headless-table/blob/main/ember-headless-table/src/plugins/column-resizing/plugin.ts#L392-L396

Screenshot

I attempted to add an isDestroyed(table) guard to the ResizeObserver callback, but it did not appear to resolve the issue, which indicates that the table is not being destroyed when it should.

@NullVoxPopuli
Copy link
Contributor

any chance you have a reproduction app?

@steveszc
Copy link
Author

I don't understand how to reproduce this... but I can reliably reproduce it on a project that isn't available publicly.

@NullVoxPopuli
Copy link
Contributor

maybe an application test that explicitly calls destroy(this.owner) and then triggers browser resize?

@steveszc
Copy link
Author

I have tried and thus far failed to get a reproduction, current state of that work is here: https://github.com/steveszc/ember-headless-table/blob/sszczecina-issue143-repro/test-app/tests/application/table-test.js

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