Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
a stab at fixing #1966
Problem description
The version check is performed synchronously.
This makes shell completions needlessly slow (in case of slow/unreliable network) and kinda defeats the purpose of using them. My bad.
patrol/packages/patrol_cli/lib/src/runner/patrol_command_runner.dart
Lines 375 to 377 in e465db0
Resources
https://stackoverflow.com/a/78657717/7009800AI-generated garbage answer, such API doesn't exist, see Design an API to support aborting requests dart-lang/http#424The
pub_updater
package doesn't provide any way to cancel an update check that is in progress. So it seems to me that the only way to do cancel the version check is to run it in a separate isolate. This seems a bit complex as isolates cannot share memory, butpub_updater.PubUpdater
andpatrol_cli.Logger
must be present in the isolate.Example 1 (using async, not working as intended)
Example 2 (using isolates, working as intended)