Skip to content

Fix NetworkImage causing spurious warning in tests - #129537

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
gnprice:pr-networkimage-httpclient
Jun 30, 2023
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
gnprice:pr-networkimage-httpclient

Conversation

@gnprice

@gnprice gnprice commented Jun 26, 2023

Copy link
Copy Markdown
Member

Fixes #129532.

This ensures that when a test properly uses debugNetworkImageHttpClientProvider to tell NetworkImage to use a fake HttpClient, we don't go ahead and try to instantiate HttpClient anyway and generate a misleading warning.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Jun 26, 2023
Fixes flutter#129532.

This ensures that when a test properly uses debugNetworkImageHttpClientProvider
to tell NetworkImage to use a fake HttpClient, we don't go ahead and
try to instantiate HttpClient anyway and generate a misleading warning.
@gnprice
gnprice force-pushed the pr-networkimage-httpclient branch from 9a1fdbb to 72b5e28 Compare June 26, 2023 05:22
@HansMuller
HansMuller requested a review from chunhtai June 30, 2023 21:41

@chunhtai chunhtai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 30, 2023
@auto-submit
auto-submit Bot merged commit 1153371 into flutter:master Jun 30, 2023
@gnprice

gnprice commented Jun 30, 2023

Copy link
Copy Markdown
Member Author

Thanks for the review!

@gnprice
gnprice deleted the pr-networkimage-httpclient branch June 30, 2023 23:21
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 1, 2023
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 1, 2023
flutter/flutter@ff838bc...aa5f4a2

2023-07-01 [email protected] Enable no_wildcard_variable_uses lint (flutter/flutter#129858)
2023-06-30 [email protected] mark packages-autoroller bringup again (flutter/flutter#129859)
2023-06-30 [email protected] Update `SwitchTheme` tests for M2/M3 (flutter/flutter#129811)
2023-06-30 [email protected] Change pub roller bot to push to flutter-pub-roller-bot/flutter.git (flutter/flutter#129844)
2023-06-30 [email protected] Fix NetworkImage causing spurious warning in tests (flutter/flutter#129537)
2023-06-30 [email protected] Roll Flutter Engine from 54b573e9c4e5 to e6b8292705a8 (4 revisions) (flutter/flutter#129852)
2023-06-30 [email protected] Upgrade integration tests to use AGP 7.3/Gradle 7.4 (flutter/flutter#129642)
2023-06-30 [email protected] Roll Packages from d4752c4 to 53ed5a0 (5 revisions) (flutter/flutter#129837)
2023-06-30 [email protected] Updated correct tasks for test ownership fix (flutter/flutter#129812)
2023-06-30 [email protected] Updated some golden image tests for M2/M3 (flutter/flutter#129794)
2023-06-30 [email protected] Remove an unnecessary assert (flutter/flutter#129796)
2023-06-30 [email protected] Update `Radio` tests for M2/M3 (flutter/flutter#129814)
2023-06-30 [email protected] Update `Switch` tests for M2/M3 (flutter/flutter#129810)
2023-06-30 [email protected] Roll Flutter Engine from 099a70ebbc60 to 54b573e9c4e5 (1 revision) (flutter/flutter#129821)
2023-06-30 [email protected] Update `SwitchListTile` tests for M2/M3 (flutter/flutter#129809)
2023-06-30 [email protected] Fix `NavigationDrawer` selected item has wrong icon color (flutter/flutter#129625)
2023-06-30 [email protected] Update basic_test.dart for M3 compliance (flutter/flutter#129714)
2023-06-30 [email protected] Roll Flutter Engine from d33343430f18 to 099a70ebbc60 (7 revisions) (flutter/flutter#129818)
2023-06-30 [email protected] Roll Flutter Engine from 68cc1a7971d5 to d33343430f18 (2 revisions) (flutter/flutter#129801)
2023-06-30 [email protected] Revert no-response to fork. (flutter/flutter#129775)
2023-06-30 [email protected] Make `DropdownMenu` be able to scroll to the highlighted item when searching. (flutter/flutter#129740)
2023-06-29 [email protected] Roll Flutter Engine from cd9ce66db14a to 68cc1a7971d5 (10 revisions) (flutter/flutter#129799)
2023-06-29 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 4.1.0 to 4.2.0 (flutter/flutter#129797)
2023-06-29 [email protected] Roll Flutter Engine from eabb22900b44 to cd9ce66db14a (1 revision) (flutter/flutter#129756)
2023-06-29 [email protected] Remove `@NonNull` to avoid warning (flutter/flutter#129472)
2023-06-29 [email protected] Remove use of any (flutter/flutter#129793)
2023-06-29 [email protected] Prepare for utf8.encode() to return more precise Uint8List type (flutter/flutter#129769)
2023-06-29 [email protected] Deletes files that should be ignored (flutter/flutter#127984)
2023-06-29 [email protected] Fix flutter_plugins by rolling revision (flutter/flutter#129781)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
@theSonGoku1991

Copy link
Copy Markdown

I recently upgraded to the new flutter version and notice that I can no longer load images via Image.network. Everytime I try, I get an error that the host addess could not be resolved. I am not saying that his is related to your fix, I just noticed that this happens to me since the last upgrade and I was not able to fix it yet (emulator has a network connection, AndroidManifest.xml got the internet connection permission line etc.)

@gnprice

gnprice commented Sep 1, 2023

Copy link
Copy Markdown
Member Author

@theSonGoku1991 Please go ahead and file that as a new issue, including all the information requested in the new-issue template. That will be the best way to help someone investigate what you're seeing and get it fixed.

creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@ff838bc...aa5f4a2

2023-07-01 [email protected] Enable no_wildcard_variable_uses lint (flutter/flutter#129858)
2023-06-30 [email protected] mark packages-autoroller bringup again (flutter/flutter#129859)
2023-06-30 [email protected] Update `SwitchTheme` tests for M2/M3 (flutter/flutter#129811)
2023-06-30 [email protected] Change pub roller bot to push to flutter-pub-roller-bot/flutter.git (flutter/flutter#129844)
2023-06-30 [email protected] Fix NetworkImage causing spurious warning in tests (flutter/flutter#129537)
2023-06-30 [email protected] Roll Flutter Engine from 54b573e9c4e5 to e6b8292705a8 (4 revisions) (flutter/flutter#129852)
2023-06-30 [email protected] Upgrade integration tests to use AGP 7.3/Gradle 7.4 (flutter/flutter#129642)
2023-06-30 [email protected] Roll Packages from d4752c4 to 53ed5a0 (5 revisions) (flutter/flutter#129837)
2023-06-30 [email protected] Updated correct tasks for test ownership fix (flutter/flutter#129812)
2023-06-30 [email protected] Updated some golden image tests for M2/M3 (flutter/flutter#129794)
2023-06-30 [email protected] Remove an unnecessary assert (flutter/flutter#129796)
2023-06-30 [email protected] Update `Radio` tests for M2/M3 (flutter/flutter#129814)
2023-06-30 [email protected] Update `Switch` tests for M2/M3 (flutter/flutter#129810)
2023-06-30 [email protected] Roll Flutter Engine from 099a70ebbc60 to 54b573e9c4e5 (1 revision) (flutter/flutter#129821)
2023-06-30 [email protected] Update `SwitchListTile` tests for M2/M3 (flutter/flutter#129809)
2023-06-30 [email protected] Fix `NavigationDrawer` selected item has wrong icon color (flutter/flutter#129625)
2023-06-30 [email protected] Update basic_test.dart for M3 compliance (flutter/flutter#129714)
2023-06-30 [email protected] Roll Flutter Engine from d33343430f18 to 099a70ebbc60 (7 revisions) (flutter/flutter#129818)
2023-06-30 [email protected] Roll Flutter Engine from 68cc1a7971d5 to d33343430f18 (2 revisions) (flutter/flutter#129801)
2023-06-30 [email protected] Revert no-response to fork. (flutter/flutter#129775)
2023-06-30 [email protected] Make `DropdownMenu` be able to scroll to the highlighted item when searching. (flutter/flutter#129740)
2023-06-29 [email protected] Roll Flutter Engine from cd9ce66db14a to 68cc1a7971d5 (10 revisions) (flutter/flutter#129799)
2023-06-29 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 4.1.0 to 4.2.0 (flutter/flutter#129797)
2023-06-29 [email protected] Roll Flutter Engine from eabb22900b44 to cd9ce66db14a (1 revision) (flutter/flutter#129756)
2023-06-29 [email protected] Remove `@NonNull` to avoid warning (flutter/flutter#129472)
2023-06-29 [email protected] Remove use of any (flutter/flutter#129793)
2023-06-29 [email protected] Prepare for utf8.encode() to return more precise Uint8List type (flutter/flutter#129769)
2023-06-29 [email protected] Deletes files that should be ignored (flutter/flutter#127984)
2023-06-29 [email protected] Fix flutter_plugins by rolling revision (flutter/flutter#129781)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@ff838bc...aa5f4a2

2023-07-01 [email protected] Enable no_wildcard_variable_uses lint (flutter/flutter#129858)
2023-06-30 [email protected] mark packages-autoroller bringup again (flutter/flutter#129859)
2023-06-30 [email protected] Update `SwitchTheme` tests for M2/M3 (flutter/flutter#129811)
2023-06-30 [email protected] Change pub roller bot to push to flutter-pub-roller-bot/flutter.git (flutter/flutter#129844)
2023-06-30 [email protected] Fix NetworkImage causing spurious warning in tests (flutter/flutter#129537)
2023-06-30 [email protected] Roll Flutter Engine from 54b573e9c4e5 to e6b8292705a8 (4 revisions) (flutter/flutter#129852)
2023-06-30 [email protected] Upgrade integration tests to use AGP 7.3/Gradle 7.4 (flutter/flutter#129642)
2023-06-30 [email protected] Roll Packages from 3290cf7 to 4e0c818 (5 revisions) (flutter/flutter#129837)
2023-06-30 [email protected] Updated correct tasks for test ownership fix (flutter/flutter#129812)
2023-06-30 [email protected] Updated some golden image tests for M2/M3 (flutter/flutter#129794)
2023-06-30 [email protected] Remove an unnecessary assert (flutter/flutter#129796)
2023-06-30 [email protected] Update `Radio` tests for M2/M3 (flutter/flutter#129814)
2023-06-30 [email protected] Update `Switch` tests for M2/M3 (flutter/flutter#129810)
2023-06-30 [email protected] Roll Flutter Engine from 099a70ebbc60 to 54b573e9c4e5 (1 revision) (flutter/flutter#129821)
2023-06-30 [email protected] Update `SwitchListTile` tests for M2/M3 (flutter/flutter#129809)
2023-06-30 [email protected] Fix `NavigationDrawer` selected item has wrong icon color (flutter/flutter#129625)
2023-06-30 [email protected] Update basic_test.dart for M3 compliance (flutter/flutter#129714)
2023-06-30 [email protected] Roll Flutter Engine from d33343430f18 to 099a70ebbc60 (7 revisions) (flutter/flutter#129818)
2023-06-30 [email protected] Roll Flutter Engine from 68cc1a7971d5 to d33343430f18 (2 revisions) (flutter/flutter#129801)
2023-06-30 [email protected] Revert no-response to fork. (flutter/flutter#129775)
2023-06-30 [email protected] Make `DropdownMenu` be able to scroll to the highlighted item when searching. (flutter/flutter#129740)
2023-06-29 [email protected] Roll Flutter Engine from cd9ce66db14a to 68cc1a7971d5 (10 revisions) (flutter/flutter#129799)
2023-06-29 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 4.1.0 to 4.2.0 (flutter/flutter#129797)
2023-06-29 [email protected] Roll Flutter Engine from eabb22900b44 to cd9ce66db14a (1 revision) (flutter/flutter#129756)
2023-06-29 [email protected] Remove `@NonNull` to avoid warning (flutter/flutter#129472)
2023-06-29 [email protected] Remove use of any (flutter/flutter#129793)
2023-06-29 [email protected] Prepare for utf8.encode() to return more precise Uint8List type (flutter/flutter#129769)
2023-06-29 [email protected] Deletes files that should be ignored (flutter/flutter#127984)
2023-06-29 [email protected] Fix flutter_plugins by rolling revision (flutter/flutter#129781)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NetworkImage in tests causes spurious warning about HttpClient

3 participants