You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MBL-19275][Android] Fix file attachment duplicate uploads and infinite loading (#3295)
Fix race condition causing duplicate file uploads and infinite loading indicators
in SpeedGrader comments by passing file paths atomically with upload events.
refs: MBL-19275
affects: Teacher
release note: Fixed an issue where file attachments in SpeedGrader comments could be uploaded multiple times and get stuck in an infinite loading state
test plan:
- Unit tests: All 20 tests pass including 5 new tests for file upload flows
- Manual testing: Build and run Teacher app on emulator
- Verify file uploads in SpeedGrader comments work correctly without duplicates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>
Copy file name to clipboardExpand all lines: libs/pandautils/src/main/java/com/instructure/pandautils/features/speedgrader/grade/comments/SpeedGraderCommentsSection.kt
+13-9Lines changed: 13 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -208,16 +208,20 @@ fun SpeedGraderCommentsSection(
208
208
if (state.fileSelectorDialogData !=null) {
209
209
val fragmentManager =LocalContext.current.getFragmentActivity().supportFragmentManager
210
210
211
-
val bundle =FileUploadDialogFragment.createTeacherSubmissionCommentBundle(
212
-
state.fileSelectorDialogData.courseId,
213
-
state.fileSelectorDialogData.assignmentId,
214
-
state.fileSelectorDialogData.userId,
215
-
state.fileSelectorDialogData.attempt
216
-
)
211
+
// Check if dialog is already showing to prevent duplicates
212
+
val existingDialog = fragmentManager.findFragmentByTag(FileUploadDialogFragment.TAG)
213
+
if (existingDialog ==null) {
214
+
val bundle =FileUploadDialogFragment.createTeacherSubmissionCommentBundle(
Copy file name to clipboardExpand all lines: libs/pandautils/src/main/java/com/instructure/pandautils/features/speedgrader/grade/comments/SpeedGraderCommentsViewModel.kt
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -206,7 +206,7 @@ class SpeedGraderCommentsViewModel @Inject constructor(
Copy file name to clipboardExpand all lines: libs/pandautils/src/test/java/com/instructure/pandautils/features/speedgrader/grade/comments/SpeedGraderCommentsViewModelTest.kt
0 commit comments