- 
                Notifications
    You must be signed in to change notification settings 
- Fork 121
[MBL-19393][S/T] RCE - Fixed issue where media text entry submitted via RCE are not playable when viewed later #3733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
refs: MBL-19393 affects: Student, Teacher builds: Student, Teacher release note: Fixed issue where media text entry submissions are not being playable.
This reverts commit 44ea0fd.
This reverts commit 1aaa663.
refs: MBL-19393 affects: Student, Teacher builds: Student, Teacher release note: Fixed issue where media text entry submissions using RCE are not being playable when viewed later.
| Pull Request Review: Media Text Entry Submission FixSummaryThis PR fixes an issue where media uploaded via RCE in text entry submissions were not playable when viewed later. The solution switches from using  Code Quality ✅Strengths
 Swift Best Practices ✅
 Potential Issues & Concerns1. Critical: Missing Nil Check in JavaScript  | 
| Code Review for MBL-19393Thanks for the fix! This addresses a real issue where media uploads in RCE were using the wrong iframe URL path. I've reviewed the changes and have the following feedback: ✅ Positive Aspects
 🐛 Potential Issues1. Critical: Missing nil handling in JavaScript (RichContentEditor.js:182)When rce_enhancements feature flag is enabled, the code uses attachmentID directly in the iframe URL without checking if it's undefined/null. If attachmentID is undefined/null, this will generate /media_attachments_iframe/undefined or /media_attachments_iframe/null, breaking media playback. Recommendation: Add a fallback to the old media_objects_iframe URL when attachmentID is missing. 2. Test Coverage GapsThe existing tests (UploadMediaTests.swift:86-140) need updates: 
 Recommendation: 
 3. Core Data MigrationThe PR adds a new mediaAttachmentID attribute to the File entity (Database.xcdatamodel/contents:874). Question: Is this a lightweight migration? Since the attribute is optional, it should be fine, but please confirm that no migration code is needed for adding optional attributes. 🔒 Security ConsiderationsLow Risk: The new attachmentID appears to come from the API response and is properly handled. However, verify that the attachment ID is validated server-side to prevent unauthorized access. ⚡ Performance ConsiderationsNo concerns: The changes don't introduce any performance issues. 📝 Style & Best Practices
 🎯 SummaryThe fix is architecturally sound and addresses the root cause. The main concern is the missing nil check in JavaScript which could cause regressions for older content or edge cases where the API doesn't return an attachment ID. Recommended Actions Before Merge: 
 Testing Recommendations: 
 Let me know if you'd like help implementing any of these suggestions! | 
| 
 Release Note:Fixed issue where media text entry submissions using RCE are not being playable when viewed later. Affected Apps: Student, TeacherBuilds: Student, Teacher
 | 
| PR Review - MBL-19393: RCE Media Attachment FixOverviewThis PR fixes an issue where media uploaded through the Rich Content Editor (RCE) were not playable when viewed later. The fix changes the media iframe URL from using media_objects_iframe to media_attachments_iframe, which requires passing the attachment ID alongside the media ID. Code Quality & Best PracticesPositive aspects: 
 Observations: 
 Potential Bugs & IssuesCritical: Backward compatibility concern (RichContentEditor.js:182) - The code now uses media_attachments_iframe but attachmentID could be null/undefined in some scenarios: 
 This would result in an invalid URL like /media_attachments_iframe/undefined. The code should fall back to the old URL format when attachmentID is missing. Core Data migration - Adding mediaAttachmentID to the File entity requires a lightweight migration. Verified the new attribute is marked as optional in Database.xcdatamodel. Performance ConsiderationsNo significant performance concerns identified: 
 Security ConcernsMinor concern: URL injection risk (RichContentEditor.js:182) - While the IDs come from trusted backend responses, attachmentID is inserted directly into an iframe src without sanitization. Canvas backend should validate these IDs. Test CoverageTest updates look good: 
 Recommendation: Consider adding a test case for the backward compatibility scenario where attachment_id is nil in the API response. Additional Recommendations
 SummaryThis is a well-structured fix that properly threads the attachment ID through the media upload flow. The main concern is backward compatibility - the JavaScript code needs to handle cases where attachmentID is missing and fall back to the original URL format. Otherwise, the implementation is solid with good test coverage. Recommendation: Address the backward compatibility issue before merging, then approve. | 
| BuildsCommit: Fix unit tests (f0a6a21) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code + 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this is not fixed for me.
I've tried both apps, and I get the exact results which are in the ticket's videos:
- Login with respective test account
- Assignments > AssignmentDetails > Submissions (or SpeedGrader)
- I saw the videos thumbnail, there is a play button
- Tap play, and it's black box with crossed play button
iPhone 14 @ iOS 18.2
iPad 10 @ iOS 17.2
| 
 The testing should not be about viewing the old submission, it should be about submitting a new text entry with media embedded using RCE, then after that you check both submission details and SpeedGrader to view them. Make sure before you do that, to turn on "Assignment Enhancements - Student" feature flag on the course you are submitting to. See "Steps to reproduce" on the ticket. Old submissions using that way, would still be in-viewable for using malformed html content. | 
| 
 I tried that now, but still the same, the video will not play. 
 it is enabled for the course ScreenRecording_10-31-2025.13-03-02_1.MP4 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uploaded a video to the test course from the PR app on iOS 26, not working, same as Richard said
:(
refs: MBL-19393
affects: Student, Teacher
builds: Student, Teacher
release note: Fixed issue where media text entry submissions using RCE are not being playable when viewed later.
What changed?
The fix was basically at pass uploaded media
attachmentIDto RCE, so we can use that with updated URL of media iframe:/media_attachments_iframe/${attachmentID}Rather than,
/media_objects_iframe/${mediaID}Test Plan
See ticket's description for test accounts.
Make sure to follow
Steps to reproduceshown in the ticket.Checklist