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

Route deactivate hook #514

Open
thec0keman opened this issue Jun 29, 2019 · 3 comments
Open

Route deactivate hook #514

thec0keman opened this issue Jun 29, 2019 · 3 comments

Comments

@thec0keman
Copy link

Hey, just noticed that the route deactivate hook runs after a test has completed. In our case, we have the deactivate hook fire off a network request, which throws an error because the test server is already shut down.

Is this expected behavior for how the test harness works? A simple short-term solution is to not fire the network request if in a test environment, but this seems less than ideal.

Thanks!

@vincentcapicotto
Copy link

Hello,
I have a similar issue, I set a property object value in the deactivate hook of the route, but when I run an acceptance test I have an error "calling set on destroyed object"

@arm1n
Copy link

arm1n commented Feb 12, 2020

We're experiencing the same problem. We first upgraded ember-source to 3.16.0. Afterwards, we also upgraded ember-data to 3.16.0. We are now facing a bunch of failing tests, which are unsuccessful in calling rollbackAttributes() from deactivate route hooks.

The error says: Cannot read property 'removeCompletelyFromOwn' of undefined - this is something very deep within ember-data internals and does not happen when the application runs outside of testing environment.

Any help / feedback from the team is highly appreciated!

@James1x0
Copy link

James1x0 commented May 13, 2020

@arm1n For our app, we tracked this message down to a 404 for a belongsTo, where we were then deleting the parent record. I feel as though this shouldn't result in an error, though, as the intent isn't to delete the child record.

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

4 participants