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

Resolve #7874 - stop too many fetch calls to docmanager-extension on … #7879

Merged
merged 2 commits into from Feb 15, 2020

Conversation

ikiw
Copy link
Contributor

@ikiw ikiw commented Feb 13, 2020

Fix for #7874, to stop too many fetch calls to docmanager-extension. This happens as there is a change event that gets emit from a forEach loop. All requests info are the same and the response received is the same which make the calls to be redundant. So the fix is to restrict the number of calls to 1.

References

#7874

Code changes

Code change is to register a callback that does not trigger a reload (fetch call) when an existing promise is already pending. The promise is tracked by maintaining a promisePending boolean flag. This ensures that even when multiple change events are emitted from a loop, it'll avoid creating multiple promises which ends up in redundant requests.

User-facing changes

Backwards-incompatible changes

No

Before Fix Network Log
Before Fix

After Fix Network Log
Aftex Fix

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@blink1073 blink1073 added this to the 2.0 milestone Feb 15, 2020
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks @ikiw, and congrats on your first contribution to JupyterLab!

@blink1073 blink1073 merged commit b66bb79 into jupyterlab:master Feb 15, 2020
ikiw added a commit to ikiw/jupyterlab that referenced this pull request Feb 25, 2020
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Mar 17, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg:docmanager status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants