Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Conversation

@natebosch
Copy link
Contributor

Fixes dart-lang/tools#821

The late final field isn't instantiated until it is read, so without
forcing instantiation in the constructor there is no timer updating the
display. Move initialization back into the constructor.

Other cleanup:

  • Remove the _index fields since it is otherwise identical to
    _timer.ticks.
  • Use a Github Action config that more closely matches our other
    packages.
  • Replace homepage with repository in the pubspec.

There are no existing tests for the spinner, and adding one would be a
large task - this code was not written with testability in mind. For now
leave this untested.

Fixes #60

The `late final` field isn't instantiated until it is read, so without
forcing instantiation in the constructor there is no timer updating the
display. Move initialization back into the constructor.

Other cleanup:
- Remove the `_index` fields since it is otherwise identical to
  `_timer.ticks`.
- Use a Github Action config that more closely matches our other
  packages.
- Replace `homepage` with `repository` in the pubspec.

There are no existing tests for the spinner, and adding one would be a
large task - this code was not written with testability in mind. For now
leave this untested.
@natebosch natebosch requested a review from jakemac53 May 5, 2021 18:37
@google-cla google-cla bot added the cla: yes label May 5, 2021
@jakemac53
Copy link
Contributor

I believe this change also needs to be fixed 2fbb4eb#diff-0dab707dd5561665494c8ed4794f8c69d076e372014573885af1eb48e70eef71L261

@natebosch
Copy link
Contributor Author

The one in VerboseLogger isn't late so it is still OK.

@jakemac53
Copy link
Contributor

The one in VerboseLogger isn't late so it is still OK.

ah ok I see it changed from late to final, 👍

@natebosch natebosch merged commit 8a73cd7 into master May 5, 2021
@natebosch natebosch deleted the fix-spinner branch May 5, 2021 20:18
@devoncarew
Copy link
Contributor

Thanks for following up on dart-lang/tools#821 !

mosuem pushed a commit to dart-lang/tools that referenced this pull request Oct 25, 2024
Fixes dart-lang/cli_util#60

The `late final` field isn't instantiated until it is read, so without
forcing instantiation in the constructor there is no timer updating the
display. Move initialization back into the constructor.

Other cleanup:
- Remove the `_index` fields since it is otherwise identical to
  `_timer.ticks`.
- Use a Github Action config that more closely matches our other
  packages.
- Replace `homepage` with `repository` in the pubspec.

There are no existing tests for the spinner, and adding one would be a
large task - this code was not written with testability in mind. For now
leave this untested.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

regression where the CLI progress spinner doesn't spin

4 participants