-
Notifications
You must be signed in to change notification settings - Fork 25
blockAllRequestsInProgress
option for BlockUIHttpModule does not block 2nd HTTP request for sequential requests
#126
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
Comments
@joboyx thanks for all the info! Have you tried updating to the |
@joboyx I just wanted to follow up my last comment with these 2 stackblitz projects. I created 2 different scenarios, one with parallel requests and the other with nested requests. I ended up creating these using https://stackblitz.com/edit/github-http-nested-6tpjzq?file=src%2Fapp%2Fapp.component.ts |
Thanks for those test projects, didn't know we can do that. :) Here, I forked your stackblitz project and was able to reproduce the issue: Issue occurs with Promise with await/async. |
@joboyx thanks for the example. So I forked your stackblitz and updated ng-block-ui to use the Over the lifespan of the library, I have had a few PR come in that fixed someones specific issue but broke other edge cases so in |
Thanks upgrading to 3.X fixed my issue. Here's the update stackblitz project with all of my use cases working with 8.X -- https://stackblitz.com/edit/ng-block-ui-issue-126-axsq2v Just want to note that to make it work both for Promise and Observers I need to set However, if I apply the changes for 3.X to our code base some instances are now broken. Like on this page. The block-ui did not unblock totally even after all requests are done. In this scenario 2 requests are subscribe and 1 request is a promise without await. But I can't seem to replicate this issue in the stackblitz project I provided above (using 3.X with So given this I can't still use this as a solution, it is more broken that it actually is in 2.1.8. As workaround I'm converting our nested and parallel Observable.subscribe() to promises and this make ng-block-ui work properly with |
Thanks for the additonal info. Let me keep looking into this, thanks. |
@joboyx so after doing a bunch of testing, I think I have fixed the issue you are seeing. I have released a new version ( Take a look and let me know if this fixes your issue. |
@kuuurt13, I've tested Thanks for the effort on fixing this! Really appreciate it. It's my first time to have an interaction like this with a maintainer. :) I think you can close this now. Thanks. |
Just one more thing. This parameter -- |
@joboyx I'm glad it fixed your issue. Thanks for providing so many details for your issue, it helped a lot! As for |
Hmm okay. But just want you to note that I've still encountered a scenario where some requests are still ongoing but block-ui already unblocked if Sorry, but I won't be able to give you the specific scenario. But that's my current config as stated above. Not expecting any action from you for this. Just an FYI. Thanks again. |
@joboyx if you can pinpoint and reproduce the issue where this happening feel free to share and I can take a look. As for that setting, from my testing it seems to be working as designed. I created a comprehensive example here that shows how it is working. Feel free to change the setting and see how it impacts the blocking. |
Found another issue in
See this stackblitz project -- https://stackblitz.com/edit/ng-block-ui-issue-126-request-filter Take note that when running the project in stackblitz -- the issue does NOT happen, as expected, no block-ui is happening. But if you download the project and run locally, all requests are still being blocked even if there's |
If it is only happening locally then it might be an issue with Angular's compiler since I think stackblitz serves Angular apps differently. I looked real quick locally and it looks like |
@joboyx it looks like there was an issue with how Angular was handling values passed to |
Btw, the issue I mentioned with |
Great, good to hear! Going to close this then. Thanks again for providing all these details/examples to help me reproduce the issue. |
INFO:
From the parameter name
blockAllRequestsInProgress
, user expects that this will block all HTTP calls regardless if there are called in parallel or sequentially.However in our app, there are instances where in if there are 2 consecutive HTTP requests (usually blocked by await) the first request gets blocked, but the 2nd request is not blocked.
As workaround what I did was to set
blockAllRequestsInProgress
tofalse
.Which is misleading. And may cause issues for use cases where transactions should not be called repeatedly in parallel (debounce).
Sample code:
There's also a question in StackOverflow which I answered with my workaround.
Also even if I upgrade to 2.1.8, issue still exists.
Thanks!
The text was updated successfully, but these errors were encountered: