Repository navigation
v2.26.2
What's Changed
Bug Fix 🐛
Fixed critical crash: IllegalStateException: FragmentManager is already executing transactions when launching the bot with an invalid or null botId in SDK v2.26.1.
Issue:
- Crash occurred intermittently in production when
botIdwas null or empty - Stack trace:
FragmentManager.handleOnBackPressed→OnBackPressedDispatcher.onBackPressed→YellowBotWebviewFragment.onStart(line 1026) - Root cause:
onBackPressedDispatcher.onBackPressed()was called synchronously insideonStart()during fragment transaction execution, causing a re-entrant transaction conflict
Resolution:
- Deferred back press execution using
view?.post { }to run after the FragmentManager transaction completes - Added
isAddedlifecycle guards to prevent operations on detached fragments - Added defensive checks in "close-bot" event handler and close button click listener
Technical Details
Technical Approach:
- Used
view?.post { }to defer execution to the next message loop iteration, ensuring FragmentManager transaction completion isAddedchecks follow Android Fragment lifecycle best practices- No performance impact; deferred execution is lightweight
- Maintains backward compatibility with existing behavior
Testing Recommendations:
- Launch bot with invalid/null
botId- should close gracefully without crash - Test rapid open/close scenarios
- Test during configuration changes (screen rotation)
- Verify normal flow with valid
botIdcontinues to work correctly