IllegalStateException in Drawer.onDrawerClosed: fragment transaction committed after onSaveInstanceState
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 77/100
Hướng nghiên cứu
Bắt đầu trong Drawer.java, đặc biệt là ở onDrawerClosed() tại dòng 776 và phần thiết lập giao dịch cho “FTP server” và “Apps” tại dòng 537 và 620. Kiểm tra cách drawer xử lý một giao dịch fragment đang chờ sau khi activity lưu trạng thái, sau đó chạy các bài kiểm thử drawer hoặc fragment liên quan nếu có. Công việc hoàn tất khi các thao tác của drawer không còn gây lỗi nếu hoạt ảnh đóng kết thúc sau khi trạng thái được lưu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Kotlin
- Star
- 6.5k
- Fork
- 1.7k
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TeamAmaze/AmazeFileManager
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
TeamAmaze/AmazeFileManager#4800 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
About page support descriptions are clipped on the right at large display and font sizesCó thể đã có người làm @mvanhorn đã nhận 11 ngày trước. Đang mởArea-UIUX Issue-Easy (good first issue) Issue-Glitch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TeamAmaze/AmazeFileManager#4781 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area-FileOperations Issue-Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
TeamAmaze/AmazeFileManager#4131 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
From-Email Issue-Feature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
TeamAmaze/AmazeFileManager#4796 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Renaming a parent folder makes a hidden file visible and leaves the old path in Hidden FilesCó thể đã có người làm @sanketpatel32 đã nhận hôm nay. Đang mởArea-FileOperations Area-HiddenFiles Issue-Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
TeamAmaze/AmazeFileManager#4794 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TeamAmaze/AmazeFileManager
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
thtbee/nectarlink#912 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug 🐞
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
grote/Transportr#1029 ·
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
FossifyOrg/Gallery#1235 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryĐang mởbug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsotto/sotto-authenticator#139 ·
Maintainer thường phản hồi trong vòng 1 ngày