Skip to content

ng update log messages printed twice #15839

Closed
@devversion

Description

@devversion

🐞 Bug report

Command

- [X] update

Is this a regression?

Yes

Description

Running ng update and assuming the migration makes changes, results in duplicate messages.

e.g.

UPDATE package.json (2594 bytes)
UPDATE src/index.html (2108 bytes)
UPDATE package.json (2594 bytes)
UPDATE src/index.html (2108 bytes)

This seems to be because of recent changes to the ng update implementation.

const lifecycleSubscription = this.workflow.lifeCycle.subscribe(event => {
if (event.kind == 'end' || event.kind == 'post-tasks-start') {
if (!error) {
// Output the logging queue, no error happened.
logs.forEach(log => this.logger.info(log));
}
}

I've added some debug messages here and it seems that both events are fired. This causes the logs to be printed twice. e.g.

Printing logs! post-tasks-start
UPDATE package.json (2594 bytes)
UPDATE src/index.html (2108 bytes)
Printing logs! end
UPDATE package.json (2594 bytes)
UPDATE src/index.html (2108 bytes)

🌍 Your Environment


Angular CLI: 9.0.0-next.8
Node: 10.16.0
OS: win32 x64
Angular: 9.0.0-next.10
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.0-next.8
@angular-devkit/build-angular      0.900.0-next.8
@angular-devkit/build-optimizer    0.900.0-next.8
@angular-devkit/build-webpack      0.900.0-next.8
@angular-devkit/core               9.0.0-next.8
@angular-devkit/schematics         9.0.0-next.8
@angular/cdk                       9.0.0-next.0
@angular/cdk-experimental          9.0.0-next.0
@angular/cli                       9.0.0-next.8
@angular/material                  9.0.0-next.0
@angular/material-examples         9.0.0-next.0-sha-b228f079e
@angular/material-experimental     9.0.0-next.0
@angular/material-moment-adapter   9.0.0-next.0
@ngtools/webpack                   9.0.0-next.8
@schematics/angular                9.0.0-next.8
@schematics/update                 0.900.0-next.8
rxjs                               6.5.3
typescript                         3.5.3
webpack                            4.41.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions