feat(cupertino): throw on close with active requests#1910
Conversation
PR HealthLicense Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with
Unused Dependencies
|
| Package | Status |
|---|---|
| cupertino_http | ❗ Show IssuesThese packages are used outside lib/ but are not dev_dependencies: |
| http | ❗ Show IssuesThese packages may be unused, or you may be using assets from these packages: |
For details on how to fix these, see dependency_validator.
This check can be disabled by tagging the PR with skip-unused-dependencies-check.
Changelog Entry ✔️
| Package | Changed Files |
|---|
Changes to files need to be accounted for in their respective changelogs.
This check can be disabled by tagging the PR with skip-changelog-check.
Coverage ⚠️
| File | Coverage |
|---|---|
| pkgs/cupertino_http/lib/src/cupertino_client.dart | 💔 Not covered |
| pkgs/http/lib/src/client.dart | 💚 100 % |
| pkgs/http/lib/src/io_client.dart | 💚 89 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check.
Breaking changes ✔️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| cupertino_http | Breaking | 2.4.0 | 3.0.0-wip | 3.0.0-wip | ✔️ |
| http | None | 1.6.0 | 1.6.1-wip | 1.6.1-wip | ✔️ |
This check can be disabled by tagging the PR with skip-breaking-check.
API leaks ✔️
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
| Package | Leaked API symbol | Leaking sources |
|---|
This check can be disabled by tagging the PR with skip-leaking-check.
Could you elaborate on this a bit? How does it help with the diagnosis? |
natebosch
left a comment
There was a problem hiding this comment.
I think it's OK to do this either way, but is there precedence for clients that throw if they are closed while requests are ongoing? I can't recall the behavior of our existing clients.
| } | ||
| } | ||
|
|
||
| Map<String, String> _getResponseHeaders( |
There was a problem hiding this comment.
[optional] since the pr already touches the single usage point, consider renaming to _responseHeaders
https://dart.dev/effective-dart/design#avoid-starting-a-method-name-with-get
I changed the wording a bit - is it better? |
|
Yes thanks |
Makes #1894 more diagnosable by changing
CupertinoClient.closeto throw if there are pending requests. So long as the developer remembers to callclosebefore the isolate exists, they will be warned (through the exception) that they did not wait for all of requests to complete.Also makes it more clear that
Client.closemust be called.Contribution guidelines:
dart format.Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.