android-maps-compose icon indicating copy to clipboard operation
android-maps-compose copied to clipboard

fix: Prevent Clustering with composable content from displaying default markers

Open darronschall opened this issue 1 year ago • 4 comments

Thank you for opening a Pull Request!


Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [x] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • [x] Ensure the tests and linter pass
  • [x] Code coverage does not decrease (if any source code was changed)
  • [x] Appropriate docs were updated (if necessary)

Fixes #569 🦕

darronschall avatar Aug 21 '24 13:08 darronschall

Hi @darronschall , and thank you for this PR!

Upon further checking it, it seems that using the two separate SideEffect blocks could have lead to race conditions, hence the reports on why this was not always reproducible. The explicit null check makes also the code safer in case of a race condition.

I am still not able to reproduce it, but this should fix a potential concurrency issue.

kikoso avatar Aug 29 '24 13:08 kikoso

Probably fixes https://github.com/googlemaps/android-maps-compose/issues/549

kikoso avatar Aug 29 '24 13:08 kikoso

I'd update this too: https://github.com/googlemaps/android-maps-compose/blob/91b40faaf8a1195a8894737578b7a17da4f3cda4/maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering/Clustering.kt#L54-L70

gmazzotta-bit avatar Aug 29 '24 16:08 gmazzotta-bit

By the way, as I mentioned here, I really believe this is a bug in DefaultClusterRenderer, but this change should be enough to work around that.

gmazzotta-bit avatar Aug 29 '24 16:08 gmazzotta-bit

@kikoso I'm sorry for the delay here; got wrapped up in some other things. I finally had a chance to incorporate @gmazzotta-bit's suggestion around updating some additional code in the deprecated ReplaceWith comments.

Rebased this off of main and force pushed for a clean history.

darronschall avatar Nov 01 '24 12:11 darronschall

:tada: This PR is included in version 6.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

googlemaps-bot avatar Nov 05 '24 17:11 googlemaps-bot