fix: address top Crashlytics crashes in beta 2.7.14#5672
Merged
Conversation
- NumberFormatter: guard against NaN/Infinity values that crash roundToLong() (163 events, 14 users) - StoreForwardPacketHandler: catch IOException from malformed proto decode, matching existing SF++ pattern (179 events, 170 users) - SerialConnectionImpl: catch IOException from USB controlTransfer during port setup (94 events, 12 users) - NodeClusterMarkers: replace SideEffect with DisposableEffect for ViewTreeLifecycleOwner propagation, reducing race window for maps cluster renderer crash (1828 events, 987 users) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The in-flight beta (build 29320970) is showing several high-volume crashes in Crashlytics. This PR addresses the top 4 actionable issues by impact, covering ~2,264 crash events across ~1,213 users in the past week.
Approach
Each fix is minimal and defensive -- catch or guard against bad input rather than redesigning call sites:
Maps cluster renderer (1,828 events / 987 users) -- The
ComposeUiClusterRenderercreates a standaloneComposeViewfor marker bitmaps that fails to find aViewTreeLifecycleOwner. The existingSideEffectworkaround ran post-composition, leaving a race window. Switched toDisposableEffect(runs at composition time) and unconditionally propagates lifecycle/savedstate owners to bothrootViewand the hostingview.StoreAndForward proto decode (179 events / 170 users) -- Malformed mesh packets crash
StoreAndForward.ADAPTER.decode()with aProtocolException. Wrapped in try-catch matching the identical pattern already used byhandleStoreForwardPlusPlusright below it.NumberFormatter NaN (163 events / 14 users) -- Sensor telemetry can deliver NaN temperature values, which crash
roundToLong(). Added a guard returning "--" for NaN/Infinity inputs.USB serial controlTransfer (94 events / 12 users) --
setParameters()throwsIOExceptionwhen the device disconnects during port setup. Wrapped the setup sequence in try-catch with proper cleanup (closedLatch.countDown(), port close, disconnect callback).Notes
DisposableEffectfix reduces the race window but a full resolution requires an upstream library fix.:core:common:allTests,:core:data:allTests, andcompileGoogleDebugKotlin.