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 2 commits into from Feb 15, 2020


Copy link

@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.



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


Before Fix Network Log
Before Fix

After Fix Network Log
Aftex Fix

Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Feb 13, 2020

Thanks for making a pull request to JupyterLab!

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

@ikiw ikiw requested a review from afshin Feb 13, 2020
@ikiw ikiw requested review from jasongrout and telamonian Feb 13, 2020
@blink1073 blink1073 added this to the 2.0 milestone Feb 15, 2020
Copy link

@blink1073 blink1073 left a comment

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

@blink1073 blink1073 merged commit b66bb79 into jupyterlab:master Feb 15, 2020
8 of 10 checks passed
ikiw added a commit to ikiw/jupyterlab that referenced this issue Feb 25, 2020
@lock lock bot added the status:resolved-locked 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.
pkg:docmanager status:resolved-locked
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants