Skip to content

fix: ensure iframe visibility tracking is triggered on load #71

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

Draft
wants to merge 1 commit into
base: agrendalath/close-sidebar-on-mobile-after-selecting-unit
Choose a base branch
from

Conversation

Agrendalath
Copy link
Member

The previous implementation (openedx#1491) had a race condition that sometimes prevented XBlocks from being marked as viewed. Users had to scroll or resize the window to trigger visibility tracking instead of having it happen once the content loads.

Description

Testing instructions:

  1. (Optional) Set COMPLETION_BY_VIEWING_DELAY_MS = 1000 in lms/envs/private.py for easier testing. The default value is 5000.
  2. (Optional) Change publish_completion to publish_completions in lms/static/completion/js/CompletionOnViewService.js for easier testing. Otherwise, you will need to create a new XBlock for the next check or manually remove the BlockCompletion object from the DB to get the API call re-triggered the next time you view it.
  3. Use Chrome for the next steps (do not check out this branch yet).
  4. Create an HTML block with a single line. Check that the publish_completion request is not called in the Learning MFE.
  5. Check out this branch and repeat the previous step. Ensure that the request has been published.

Deadline

"None"

Other information

Private-ref: BB-9602

The previous implementation had a race condition that sometimes prevented
XBlocks from being marked as viewed. Users had to scroll or resize the window
to trigger visibility tracking instead of having it happen once content loads.
@Agrendalath Agrendalath self-assigned this Apr 5, 2025
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.

1 participant