Skip to content

v2.26.2

Choose a tag to compare

@sankalpym sankalpym released this 17 Feb 07:05
· 49 commits to dev since this release
cdd2f52

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 botId was null or empty
  • Stack trace: FragmentManager.handleOnBackPressed → OnBackPressedDispatcher.onBackPressed → YellowBotWebviewFragment.onStart (line 1026)
  • Root cause: onBackPressedDispatcher.onBackPressed() was called synchronously inside onStart() 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 isAdded lifecycle 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
  • isAdded checks 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 botId continues to work correctly