Skip to content

Fix/issue 3925 mobile progress sync#3939

Open
pradeep0153 wants to merge 3 commits into
Premshaw23:masterfrom
pradeep0153:fix/issue-3925-mobile-progress-sync
Open

Fix/issue 3925 mobile progress sync#3939
pradeep0153 wants to merge 3 commits into
Premshaw23:masterfrom
pradeep0153:fix/issue-3925-mobile-progress-sync

Conversation

@pradeep0153

Copy link
Copy Markdown
Contributor

Closes #3925.

Description

This PR addresses a critical tracking failure that was causing immense frustration for iOS users, where perfectly completed video lectures were failing to register as "Completed" in the backend database.

Changes Made

  • Conducted deep investigation into the frontend event listeners attached to the HTML5 <video> element.
  • Discovered that Mobile Safari (and iOS in general) aggressively suspends JavaScript execution when the browser is minimized, when the screen locks, or even momentarily during native full-screen playback transitions. This was causing the standard ended and final timeupdate events to randomly drop before the Axios API call to our server could fire.
  • Replaced the fragile, single-shot ended event reliance with a robust, periodic heartbeat mechanism.
  • The player now uses the highly reliable navigator.sendBeacon() API to ping the server with the user's current playback timestamp every 10 seconds. sendBeacon is specifically designed by browsers to guarantee delivery of tiny analytics payloads even if the page is actively unloading or the browser is backgrounded.

Impact

  • Data Integrity & Student Frustration: There is nothing more aggravating for an online student than spending 45 minutes diligently watching a complex lecture, only to return to the dashboard and see that the system thinks they haven't watched it at all—blocking them from taking the next quiz. By transitioning to a robust, beacon-based heartbeat tracking system, we guarantee accurate progress synchronization regardless of aggressive mobile browser throttling, completely eliminating these false-negative progress blocks.

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.

Bug: Course completion progress fails to sync when watching videos on mobile Safari

1 participant