fix: Prevent Clustering with composable content from displaying default markers
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 🦕
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.
Probably fixes https://github.com/googlemaps/android-maps-compose/issues/549
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
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.
@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.
:tada: This PR is included in version 6.2.1 :tada:
The release is available on:
v6.2.1- GitHub release
Your semantic-release bot :package::rocket: