Skip to content

[cronet_http] Fix background bugs - #1862

Merged
HosseinYousefi merged 8 commits into
masterfrom
background-bug
Dec 15, 2025
Merged

HosseinYousefi merged 8 commits into
masterfrom
background-bug

Conversation

@HosseinYousefi

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Dec 9, 2025 •

Copy link
Copy Markdown

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 None 1.7.0 1.7.1-wip 1.7.0 ✔️

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.

@HosseinYousefi
HosseinYousefi merged commit 72c7bb4 into master Dec 15, 2025
39 checks passed
@HosseinYousefi
HosseinYousefi deleted the background-bug branch December 15, 2025 17:59
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