Repository navigation
Conversation
…load The map was only reported as ready on the first 'tilesloaded' event, which never fires if a tile request stalls or fails. Also accept the first 'idle' event once the map div is laid out. Integration tests now time out waiting for the map instead of hanging until the driver fails with an opaque DriverError. Fixes flutter/flutter#193452
There was a problem hiding this comment.
Code Review
This pull request modifies the web implementation of the Google Maps Flutter plugin to ensure that onMapCreated is called even if a map tile fails to load. It updates _attachMapEvents in GoogleMapController to trigger the map-ready event using either the first tilesloaded event or the first idle event after the map's div is connected and has a positive width. Additionally, integration tests are updated to use a new helper function, waitForMap, which adds a 30-second timeout to map-creation futures to prevent test hangs. Feedback suggests also checking offsetHeight in addition to offsetWidth to guarantee the map is fully laid out and usable.
Records map lifecycle events, layout, pending tiles and Maps network activity; dumps them when waitForMap times out, and adds a stress test that measures idle vs tilesloaded across many fresh maps. For flutter/flutter#193452
onMapCreated when tiles fail to load
|
To check whether this actually removes the hang rather than just making it rarer, I ran the Results: 59 builds, 309 cold-start build-equivalents, 2,880 instrumented Caveat: the historical failures cluster by date (3 on 2026-09-25), so the builds are not fully independent and this is an upper bound on confidence. I also never caught a stalled All builds: All 59 shard_1 builds
|
The web plugin reported a map as ready (triggering
onMapCreated) only on the firsttilesloadedevent. That event requires every visible tile to download, so a single stalled or failed tile request leavesonMapCreatedpending forever. On CI, this hangsprojection_test,overlays_test, andmarker_clustering_testuntilflutter drivefails with an opaqueDriverErrorafter 20 minutes.Example CI failures:
https://ci.chromium.org/b/8669392206413648801
https://ci.chromium.org/b/8669672566864354113
Report the map as ready on the first
tilesloadedor the firstidleevent once the map<div>is attached and has a non-zero size, when the projection and bounds are available.Re-enable the tests skipped in [google_maps_flutter] Disable flaky web tests blocking latest flutter -> packages roll #13047.
Fixes flutter/flutter#193452