Skip to content

Conversation

@HosseinYousefi
Copy link
Member

By making the callbacks all async, we basically make them all fire-and-forget so a long running http request cannot callback to a potentially non-existent Dart callback synchronously and fail. Instead it will just be ignored.

Also release the JNI references eagerly to prevent reference overflow issues that could be created by doing too many requests in one go (and GC not picking up the references in the meantime)

These changes should overall fix the bugs people are facing in #1217 and #1842.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

PR Health

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/http/example/main.dart
pkgs/http_multi_server/test/cert.dart

This check can be disabled by tagging the PR with skip-license-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.

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
cronet_http Non-Breaking 1.7.0 1.7.1-wip 1.8.0
Got "1.7.1-wip" expected >= "1.8.0" (non-breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Coverage ⚠️
File Coverage
pkgs/cronet_http/lib/src/cronet_client.dart 💔 Not covered

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.

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.

super.reasonPhrase});
}

class UrlResponseInfo {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this should be private. Also, would it make sense to just add these add fields to CronetStreamedResponse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants