ADFA-2944 | Fix crash when restoring BottomSheet state#969
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThe change adds an early return condition in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6c82d05 to
40b0575
Compare
ab31572 to
4e57290
Compare
4e57290 to
deb856e
Compare
Description
Fixed a crash caused by attempting to programmatically set the
BottomSheetBehaviorstate toSTATE_SETTLINGorSTATE_DRAGGING.These are read-only internal states representing transient movement. If the Activity is recreated (e.g., during rotation or theme toggle) while the bottom sheet is settling, the
ViewModelrestores this state and attempts to apply it to the new view, causing anIllegalArgumentException.Details
The fix involves filtering out these transient states in
updateBottomSheetStatebefore applying them to the view.Error fixed:
java.lang.IllegalArgumentException: STATE_SETTLING should not be set externally.Before changes
Screen.Recording.2026-02-11.at.12.46.00.PM.mov
After changes
Screen.Recording.2026-02-11.at.1.07.38.PM.mov
Ticket
ADFA-2944
Observation
This resolves the race condition observed in Sentry reports where the app crashes upon restoration if the user was interacting with the bottom sheet during a configuration change.