Skip to content

[google_maps_flutter_ios] Fix iOS regression where updating a marker hides its info window #9127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jokerttu
Copy link
Contributor

@jokerttu jokerttu commented Apr 22, 2025

Fixes a regression introduced on version 2.12.0: Adds support for marker clustering (#6186), where visible info windows are not visible after marker updates.
Adds tests accordingly.

Fixes flutter/flutter#167459
Related to flutter/flutter#159471

Pre-Review Checklist

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

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@jokerttu jokerttu changed the title [google_maps_flutter_ios] Fix iOS info window regression where updating a marker hides its info window [google_maps_flutter_ios] Fix iOS regression where updating a marker hides its info window Apr 22, 2025
@jokerttu jokerttu marked this pull request as ready for review April 22, 2025 14:49
@jokerttu jokerttu requested a review from cbracken as a code owner April 22, 2025 14:49
@jokerttu jokerttu requested a review from stuartmorgan-g April 22, 2025 14:49
@@ -837,6 +846,26 @@ void main() {
iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId);
expect(iwVisibleStatus, true);

// Update marker and check if the info window is still visible.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to make this a separate test ('updating a marker does not hide its info window') rather than adding it to this test. Yes, there will be some duplicate boilerplate, but the fewer distinct things a test is testing, the easier each test is to maintain, debug, and understand failure in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, had this as separate test first, but desided to reduce test execution time as I saw this as part of info window toggle test.
Separated to own test as suggested.

@@ -127,6 +129,10 @@ - (void)updateFromPlatformMarker:(FGMPlatformMarker *)platformMarker
}

[self setVisible:platformMarker.visible];
Copy link
Contributor

Choose a reason for hiding this comment

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

Per investigation in #7001, this should always be the last thing in these methods. We don't yet have a complete PR that tests and enforces that, but we should still try to not make it worse in the meantime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the method call to last with comment (so that it is kept there in future changes as well).


if ([controller.marker conformsToProtocol:@protocol(GMUClusterItem)]) {
if (previousClusterManagerIdentifier &&
![previousClusterManagerIdentifier isEqualToString:clusterManagerIdentifier]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (previousClusterManagerIdentifier && ![clusterManagerIdentifier isEqualToString:previousClusterManagerIdentifier])

In general, a lot of these kind of framework methods don't handle nil arguments, so we shouldn't pass in a potentially nil clusterManagerIdentifier). This ordering will end up with [nil isEqualToString:<a value we've established as non-nil>], which gives us the intended result of NO without passing nil as an argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@stuartmorgan-g
Copy link
Contributor

Thanks for investigating my speculative theory :) I didn't have time to context switch to testing maps locally.

@jokerttu jokerttu force-pushed the fix/regression-in-displaying-info-windows-over-marker-updates branch from cfd759a to 8f417df Compare April 23, 2025 07:04
@jokerttu jokerttu requested a review from stuartmorgan-g April 23, 2025 07:05
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@jokerttu jokerttu added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 23, 2025
@auto-submit auto-submit bot merged commit 3ee5f0a into flutter:main Apr 23, 2025
82 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 24, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Apr 24, 2025
flutter/packages@41211cf...ae4f17d

2025-04-23 [email protected] [camerax] Ensure
DeviceOrientationManager stops on dispose (flutter/packages#9141)
2025-04-23 [email protected] [google_maps_flutter_ios] Fix
iOS regression where updating a marker hides its info window
(flutter/packages#9127)
2025-04-23 [email protected] Redistribute iOS
CODEOWNERS (flutter/packages#9129)

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-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

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

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
raju-muliyashiya pushed a commit to raju-muliyashiya/flutter_packages that referenced this pull request Apr 26, 2025
…hides its info window (flutter#9127)

Fixes a regression introduced on version 2.12.0: _Adds support for marker clustering_ (flutter#6186), where visible info windows are not visible after marker updates.
Adds tests accordingly.

Fixes flutter/flutter#167459
Related to flutter/flutter#159471

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
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 p: google_maps_flutter platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[google_maps_flutter][iOS] Info window disappears when updating marker icon
2 participants