Skip to content

Conversation

@tamaskozmer
Copy link
Contributor

@tamaskozmer tamaskozmer commented Dec 10, 2025

Test plan:

  • Test all the failing scenarios for file downloads (we have the list on Slack).
  • Smoke test all the media playback features

refs: MBL-19580
affects: Student, Teacher
release note: none

Checklist

  • Run E2E test suite
  • Tested in light mode

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR removes the RouteUtils.getMediaUri() method and its associated async media URL resolution logic, simplifying media handling by using URLs directly instead of making HEAD requests to resolve redirects and detect DASH content types.

Positive Changes

Significant complexity reduction - Removes unnecessary async/coroutine wrappers and HEAD requests for every media URL
Better performance - Eliminates network round-trips before playing media
Cleaner architecture - Removes the complex redirect following logic from RouteUtils
Smart fallback handling - Adds .mpd retry logic in ExoPlayerHelper for DASH videos without proper extensions

Issues Found

  • Thread safety concerns in OpenMediaAsyncTaskLoader - Instance variables are modified during async operations (libs/pandautils/src/main/java/com/instructure/pandautils/loaders/OpenMediaAsyncTaskLoader.kt:301)
  • Null pointer risk - Non-null assertion on response body without null check (libs/pandautils/src/main/java/com/instructure/pandautils/loaders/OpenMediaAsyncTaskLoader.kt:341)
  • State management issue in ExoPlayerHelper - currentUri is permanently modified during retry attempts (libs/pandautils/src/main/java/com/instructure/pandautils/utils/ExoPlayerHelper.kt:191)
  • Potential regression in URL handling - Direct string comparison may fail with query parameters (apps/student/src/main/java/com/instructure/student/activity/BaseRouterActivity.kt:319)
  • Cache key stability - Hash-based filename generation could cause cache misses (libs/pandautils/src/main/java/com/instructure/pandautils/loaders/OpenMediaAsyncTaskLoader.kt:170)
  • MimeType state pollution - Instance variable reuse could cause incorrect mimeType associations (libs/pandautils/src/main/java/com/instructure/pandautils/loaders/OpenMediaAsyncTaskLoader.kt:333)

Overall Assessment

The core idea of this refactoring is sound - removing unnecessary network requests and complexity. However, there are several implementation issues around state management, error handling, and edge cases that should be addressed before merging. The inline comments provide specific suggestions for each issue.

Testing Recommendations

Please verify:

  1. Media playback with query parameters in URLs (e.g., video.mp4?token=xyz&expires=123)
  2. DASH videos without .mpd extensions retry correctly and don't cause issues on subsequent playback attempts
  3. Concurrent media file downloads don't interfere with each other
  4. Cached files are properly reused across app sessions

@github-actions
Copy link

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1226 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 📱 Teacher App

  • Tests: 364 total, 0 failed, 0 skipped
  • Duration: 38.230s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 449 total, 0 failed, 0 skipped
  • Duration: 29.995s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2414 total, 0 failed, 0 skipped
  • Duration: 43.871s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 4453
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Wed, 10 Dec 2025 12:40:07 GMT

@github-actions
Copy link

Teacher Install Page

@github-actions
Copy link

Student Install Page

Copy link
Contributor

@adamNagy56 adamNagy56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA +1

@tamaskozmer tamaskozmer merged commit 2ae8fc1 into release/teacher-2.3.1-86 Dec 10, 2025
51 of 54 checks passed
@tamaskozmer tamaskozmer deleted the MBL-19580-fix-file-issues-teacher branch December 10, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants