Skip to content
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

Fix nasty race condition in AMP video #27740

Merged
merged 7 commits into from
Apr 15, 2020
Merged

Commits on Apr 14, 2020

  1. Fix nasty race condition in AMP video

    Under this scenario a video might not fall back to the origin on pre-render.
    Possible fix for ampproject#27109
    
    Reproduces by navigating (locally to)
    http://localhost:8000/proxy/s/stories.nonblocking.io/waffles/?usqp=mq331AQFKAGwASA%3D&amp_js_v=0.1#referrer=https%3A%2F%2Fwww.google.com&visibilityState=prerender&cap=swipe&ampshare=https%3A%2F%2Funumbox.com%2Fwebsite-development-trends-2020-amp-story%2F
    waiting for the pre-render load to fail, and then executing `AMP.viewer.receiveMessage('visibilitychange', {'state': 'visible'})` in the console.
    
    If this if not a fix for ampproject#27109, then it might be the same race, but elsewhere. The problem is that you cannot wait for `loadPromise` on a video element that has failed a source and has just had a new source provided.
    cramforce committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    c7cb622 View commit details
    Browse the repository at this point in the history
  2. Fix lint

    cramforce committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    87aaf2e View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2020

  1. - Fix tests

    - Change preload to also preload non-cache sources
    - Clarify preconnect docs about the security invariants.
    cramforce committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    d2a8fcc View commit details
    Browse the repository at this point in the history
  2. Also preconnec to orig-src

    cramforce committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    ccfcabc View commit details
    Browse the repository at this point in the history
  3. Fix type, add comment

    cramforce committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    ea12b44 View commit details
    Browse the repository at this point in the history
  4. Address review comment

    cramforce committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    59a5616 View commit details
    Browse the repository at this point in the history
  5. Simplify

    cramforce committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    9d76adc View commit details
    Browse the repository at this point in the history