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

Fix the way the pending requests module is used in settled.ts #1173

Conversation

raycohen
Copy link
Contributor

@raycohen raycohen commented Dec 2, 2021

Fixes #1172
Related to #1047

Before these changes, the code is confusing a module with one of the functions on that module.

@@ -44,20 +49,16 @@ if (typeof jQuery !== 'undefined' && _internalPendingRequests) {
// This can be removed once Ember 4.0.0 is released
EmberApplicationInstance.reopen({
willDestroy(...args: any[]) {
const internalPendingRequests = _internalPendingRequests();

if (internalPendingRequests !== 0) {
Copy link
Contributor Author

@raycohen raycohen Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the outer if statement checks that _internalPendingRequestsModule exists, which I believe makes calling off and clearPendingRequests here safe and desirable regardless of what the PendingRequestsCount is

@raycohen raycohen force-pushed the raycohen/fix-pending-requests-use-in-app-will-destroy branch from 67f0ade to 3e98c2f Compare December 2, 2021 20:29
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @raycohen!

@rwjblue rwjblue merged commit 7d0aab9 into emberjs:master Jan 11, 2022
@rwjblue rwjblue added the bug label Jan 11, 2022
@ginomiglio
Copy link

Would it be possible to cut a release that includes this change?

@raycohen
Copy link
Contributor Author

@rwjblue any chance we can get a release with this 🙏

@rwjblue
Copy link
Member

rwjblue commented Mar 31, 2022

oh dear, sorry y'all; I thought I had already released it 😭

@rwjblue
Copy link
Member

rwjblue commented Apr 4, 2022

Finally released in 2.6.2

@raycohen
Copy link
Contributor Author

raycohen commented Apr 5, 2022

Thank you!

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

Successfully merging this pull request may close these issues.

EmberApplicationInstance willDestroy in settled.ts uses the wrong internalPendingRequests
3 participants