Blockuihttpmodule issue
See original GitHub issuei use BlockUIHttpModule with this configuration:
BlockUIHttpModule.forRoot({ blockAllRequestsInProgress: true })
Say i have multiple request like:
xService.getAll().subscripe();
yService.getAll().subscripe();
what happens is block ui works until on of them return first then stop. expected => it will block ui until all request return.
also another case:
if i fire request in subscription of another like:
xService.getAll().subscripe(x => { yService.getAll().subscripe(); });
what happens it fires with xservice and when return it stops and doesn’t fire any more even with second request. expected => it will start with first request and stop after return. and start again with second one and stop after return.
may be i have mistake in something or misunderstanding so, guide me.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
@nagiramadan you are right it looks like it is no longer honoring that setting. I will work this weekend to put in a fix so that settings is honored again.
That being said, that setting was added by a contributor to keep backwards compatibility when they attempted to fix the issue you were having but to me it should be the default and only behaviors since it is confusing. I think I will be removing the setting and making it the default behavior in
3.0.0
since it should always block until all requests are complete and it also covers your scenario for a series of requestxService.getAll().subscribe(x => { yService.getAll().subscribe(); })
.Also, since
2.0
the core library now queues all calls see here. So if you have 2 requests called at the same time (start()
is called twice) then blocking shouldn’t stop until both have finished (stop()
is called twice). I’m not sure why anyone would ever want it to stop after the first one since the whole point of the module it to block for all requests.Closing due to inactivity. Please feel free to open back up if needed.