IllegalStateException in Drawer.onDrawerClosed: fragment transaction committed after onSaveInstanceState
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
Línea de trabajo
Empieza en Drawer.java, especialmente en onDrawerClosed() en la línea 776 y en la configuración de las transacciones para “FTP server” y “Apps” en las líneas 537 y 620. Comprueba cómo gestiona el drawer una transacción de fragmento pendiente después de que la actividad guarde su estado y, luego, ejecuta las pruebas pertinentes del drawer o de fragmentos, si están disponibles. El objetivo se cumple cuando las acciones del drawer ya no provocan fallos si su animación de cierre termina después de guardar el estado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The app crashes with an IllegalStateException when the navigation drawer finishes closing after the activity has already saved its state. Drawer.onDrawerClosed() calls pending_fragmentTransaction.commit() (Drawer.java:776), and the FragmentManager rejects this once state has been saved. The pending transaction is created in the drawer actions for "FTP server" and "Apps" (Drawer.java lines 537 and 620), which are committed only when the drawer finishes closing.
Found with Android Monkey testing. I could not reproduce it manually, so the exact timing is unknown.
To Reproduce
Found by Monkey, 1 crash in a 5,000-event run, about 2.5 minutes after the start:
adb shell monkey -p com.amaze.filemanager.debug -s 2 --throttle 100 --ignore-security-exceptions --pct-touch 70 --pct-motion 20 --pct-majornav 5 --pct-appswitch 5 --pct-anyevent 0 --pct-trackball 0 --pct-nav 0 --pct-syskeys 0 -v -v 5000
Monkey timing varies, so the same seed may not crash at the same point.
Suspected manual path (untested): open the side drawer, tap "Apps" or "FTP server", and send the app to the background (Home) before the drawer's close animation completes.
Expected behavior
No crash. The transaction should not be committed while the state is saved. For example, check FragmentManager.isStateSaved() first, or use commitAllowingStateLoss() if losing this transaction is acceptable.
Stack trace
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1612)
at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1652)
at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:341)
at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:306)
at com.amaze.filemanager.ui.views.drawer.Drawer.onDrawerClosed(Drawer.java:776)
at com.amaze.filemanager.ui.views.drawer.Drawer$1.onDrawerClosed(Drawer.java:243)
at androidx.drawerlayout.widget.DrawerLayout.dispatchOnDrawerClosed(DrawerLayout.java:891)
at androidx.drawerlayout.widget.DrawerLayout.updateDrawerState(DrawerLayout.java:861)
at androidx.drawerlayout.widget.DrawerLayout$ViewDragCallback.onViewDragStateChanged(DrawerLayout.java:2249)
at androidx.customview.widget.ViewDragHelper.setDragState(ViewDragHelper.java:920)
at androidx.customview.widget.ViewDragHelper$2.run(ViewDragHelper.java:345)
(Full crash log attached.)
Smartphone
- Device: Android Emulator, Medium Phone (arm64)
- OS: Android API 37
- Rooted: No
- Version: built from source, branch release/4.0, commit 94afab32b (app/build.gradle versionName 3.11.3; latest published release is v3.11.4, not tested)
Additional context
Found as part of a university software-testing course project, using Monkey testing on a debug build.
- Lenguaje dominante
- Kotlin
- Estrellas
- 6.5k
- Forks
- 1.7k
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TeamAmaze/AmazeFileManager
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
TeamAmaze/AmazeFileManager#4800 ·
Los mantenedores suelen responder en 1 día
-
About page support descriptions are clipped on the right at large display and font sizesPosiblemente ocupada @mvanhorn la tomó hace 11 días. AbiertoArea-UIUX Issue-Easy (good first issue) Issue-Glitch
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
TeamAmaze/AmazeFileManager#4781 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Area-FileOperations Issue-Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
TeamAmaze/AmazeFileManager#4131 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
From-Email Issue-Feature
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
TeamAmaze/AmazeFileManager#4796 ·
Los mantenedores suelen responder en 1 día
-
Renaming a parent folder makes a hidden file visible and leaves the old path in Hidden FilesPosiblemente ocupada @sanketpatel32 la tomó hoy. AbiertoArea-FileOperations Area-HiddenFiles Issue-Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
TeamAmaze/AmazeFileManager#4794 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TeamAmaze/AmazeFileManager
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
grote/Transportr#1029 ·
-
bug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
FossifyOrg/Gallery#1235 ·
Los mantenedores suelen responder en 1 día
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryAbiertobug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsotto/sotto-authenticator#139 ·
Los mantenedores suelen responder en 1 día
-
enhancement module:webview p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
NucleusFramework/Nucleus#1004 ·
Los mantenedores suelen responder en 1 día