Skip to content

fix: map cluster crash#4317

Merged
jamesarich merged 2 commits into
mainfrom
fix/map-crashes
Jan 26, 2026
Merged

fix: map cluster crash#4317
jamesarich merged 2 commits into
mainfrom
fix/map-crashes

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and fixes to the map feature, particularly around waypoint expiration handling and AndroidX library integration. The most significant changes include more robust handling of waypoint expiration date/time selection, a workaround for a Compose/Maps integration issue, and dependency updates to support new AndroidX features.

Waypoint Expiration Handling Improvements:

  • Refactored the logic for initializing and updating the expiration date and time in EditWaypointDialog to ensure correct handling when editing or setting new waypoints, including proper default values and state management. [1] [2] [3] [4] [5] [6]
  • Added CyclomaticComplexMethod suppression to indicate increased complexity in the dialog logic.

AndroidX Integration and Dependency Updates:

  • Added new dependencies for androidx.lifecycle.runtime.ktx, androidx.lifecycle.viewmodel.ktx, and androidx.savedstate.ktx to the project and updated the libs.versions.toml file to include these libraries. [1] [2] [3] [4]

Google Maps Compose Workaround:

  • Implemented a workaround in NodeClusterMarkers to set lifecycle and saved state owners on the activity's decor view, addressing a known issue with Google Maps Compose clustering. [1] [2]

Copyright

  • Updated copyright years in NodeClusterMarkers.kt.

Build Script Cleanup:

  • Removed duplicate or misplaced license header in build.gradle.kts for the map feature.

This commit addresses two issues: a bug in the waypoint expiration date/time picker and a rendering crash in Google Maps clustering.

### Key Changes:

-   **fix(map): Waypoint Expiration Picker**
    -   The date and time pickers for waypoint expiration are now correctly initialized. Previously, they would reset to the current time plus eight hours, discarding any existing expiration value. Now, they correctly reflect the waypoint's current expiration time when it exists.
    -   State handling for the picker's calendar instance is improved to ensure date and time selections are preserved correctly across interactions.

-   **fix(map): Google Maps Cluster Rendering**
    -   A workaround has been implemented to resolve a crash related to `googlemaps/android-maps-compose/issues/858`.
    -   The `NodeClusterMarkers` composable now manually sets the `LifecycleOwner` and `SavedStateRegistryOwner` on the activity's decor view. This ensures that the internal `ComposeView` used by the clustering library can correctly find these owners when traversing the view tree, preventing a crash during marker rendering.
    -   Added `lifecycle-runtime-ktx`, `lifecycle-viewmodel-ktx`, and `savedstate-ktx` dependencies to support this fix.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich enabled auto-merge January 26, 2026 12:34
@github-actions github-actions Bot added the bugfix PR tag label Jan 26, 2026
@codecov

codecov Bot commented Jan 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (a28aa4d) to head (5207d7d).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4317   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          3       3           
  Lines         28      28           
  Branches       8       8           
=====================================
  Misses        28      28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 7ffd5bc Jan 26, 2026
11 checks passed
@jamesarich jamesarich deleted the fix/map-crashes branch January 26, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant