Describe the Bug
The log sheet's state is not handled correctly, which means that it can easily cause the app to crash when its state is not properly destroyed and many instances of it are launched consecutively. This puts the sheet in an illegal state and crashes the app.
To Reproduce
Steps to reproduce the behavior:
Go to 'More'
Click on 'Log' repeatedly
The app crashes
Expected Behavior
The app should not crash.
What Custom Configuration Do You Use?
Not applicable
Smartphone (please complete the following information):
Device: Pixel 8
OS: Android 14
Version: v17.2.1 RC 1
Crash Logs (Advanced)
FATAL EXCEPTION: main
Process: org.torproject.android, PID: 15942
java.lang.IllegalStateException: Fragment already added: LogBottomSheet{a950fd8} (b96c57b4-0ed5-4790-b33f-171e2be7e5fa tag=OrbotActivity)
at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1481)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:387)
at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1965)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1873)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1823)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Describe the Bug The log sheet's state is not handled correctly, which means that it can easily cause the app to crash when its state is not properly destroyed and many instances of it are launched consecutively. This puts the sheet in an illegal state and crashes the app.
To Reproduce Steps to reproduce the behavior:
Expected Behavior The app should not crash.
What Custom Configuration Do You Use? Not applicable
Screenshots Screen_recording_20240406_140522.webm
Smartphone (please complete the following information):
Crash Logs (Advanced)
Additional Context None