Skip to content

Testability.whenStable does not work for chained http calls #20921

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

Closed
lyml opened this issue Dec 10, 2017 · 2 comments · Fixed by angular/zone.js#1055
Closed

Testability.whenStable does not work for chained http calls #20921

lyml opened this issue Dec 10, 2017 · 2 comments · Fixed by angular/zone.js#1055
Labels
area: common/http Issues related to HTTP and HTTP Client freq2: medium type: bug/fix
Milestone

Comments

@lyml
Copy link
Contributor

lyml commented Dec 10, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When chaining http calls the testability.whenStable callback is run after the first http call is made

Expected behavior

The when stable callback should be run after the entire chain of http calls is completed

Minimal reproduction of the problem with instructions

I have produced a repository from a clean ng new where the e2e tests demonstrates this funcionality.

https://github.com/lyml/chained-http

See also:

angular/protractor#4582

Where the problem is discussed in more detail.

What is the motivation / use case for changing the behavior?

Testabilitys whenStable is, as far as I can tell, only there to make test frameworks like protractor capable of determining when there are no more background tasks. This works properly for single http calls and chained setTimeout calls however for specifically http calls that trigger a new http call it incorrectly marks the testabity as stable.

Environment


yarn run v1.3.2
$ ng -v

Angular CLI: 1.6.0
Node: 8.9.3
OS: linux x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack: 3.10.0

Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

The issue is also confirmed in Angular 4.4.6

@jasonaden jasonaden added the area: core Issues related to the framework runtime label Dec 11, 2017
@chuckjaz chuckjaz added area: common/http Issues related to HTTP and HTTP Client and removed area: core Issues related to the framework runtime labels Dec 12, 2017
alexeagle pushed a commit that referenced this issue Jan 17, 2018
Fixes an issue where chained http calls would prematurely call
testability whenStable callbacks after the first http call.

Fixes #20921

PR Close #20924
@chuckjaz
Copy link
Contributor

#20924 was reverted.

@chuckjaz chuckjaz reopened this Jan 17, 2018
@ngbot ngbot bot added this to the Backlog milestone Jan 23, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this issue Feb 23, 2018
Fixes an issue where chained http calls would prematurely call
testability whenStable callbacks after the first http call.

Fixes angular#20921

PR Close angular#20924
@ngbot ngbot bot modified the milestones: Backlog, needsTriage Feb 26, 2018
leo6104 pushed a commit to leo6104/angular that referenced this issue Mar 25, 2018
Fixes an issue where chained http calls would prematurely call
testability whenStable callbacks after the first http call.

Fixes angular#20921

PR Close angular#20924
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: common/http Issues related to HTTP and HTTP Client freq2: medium type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants