amphtml: [amp-subscriptions] Fetch entitlements timeout error on Android Google News app

What’s the issue?

Fetch entitlements timeout error when opening an amp page from the Google News Android app. The page must have the amp-subscriptions extension with a authorizationUrl that is using the SOURCE_URL substitution variable.

erro-crop

How do we reproduce the issue?

  1. Add the amp-subscriptions extension to an amp article;
  2. Add an authorizationUrl that has the SOURCE_URL substitution variable;
  3. Open the amp page from the Google News Android app(webview url parameter will be equal to 1).

While the AMP Runtime prepares the authorization request(fetch entitlements) it will occur an Error: fetch entitlements failed for local: timeout. The error seems to be occurring even before the request to the authorizationUrl is made.

Example amp-subscriptions configuration:

<script type="application/json" id="amp-subscriptions">
{
   "services":[
      {
         "authorizationUrl":"https://www.example.com/amp/132456?rid=READER_ID&url=SOURCE_URL",
         "actions":{
            "login":"https://www.example.com/amp/132456?rid=READER_ID&url=SOURCE_URL",
            "subscribe":"//example.com/subscriptions/landings"
         }
      }
   ],
   "fallbackEntitlement":{
      "source":"fallback",
      "granted":false,
      "grantReason":"METERING",
      "data":{
         "fallback":true
      }
   }
}
</script>

What browsers are affected?

Webviews on Google News Android app.

Which AMP version is affected?

I tested on versions 012012232217000 and 012012301722001, both had the same problem.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (21 by maintainers)

Most upvoted comments

OK. Then I guess that’s the real root cause. I agree with Dima. The protocol is that AMP runtime expect a messaging channel when seeing #webview=1 in the URL.

If the webview specifies #webview=1 it means that it wants to supply messaging to adjust some of the page’s behavior. If we remove one dependency now, we’d quickly run into a next one. E.g. a cid generation or anything else. So I don’t think it’s as helpful trying to minimize the deps unless we see a way to bypass them in 100% of cases, which I don’t yet see how to.

yes. it was introduced by this PR: https://github.com/ampproject/amphtml/pull/5606/files#diff-8a281cee899c97e8bea38ad6acd584e37576f42b76411813739ba4c2f8660a11R167

if I remember correctly, it was for feature “ALP (AMP Landing Page)” to finish its impression tracking which used source URL to store data that needs to be removed before it is further used as SOURCE_URL

@cramforce could you remind me what the final status ALP is? I think it’s dead?

My early finding is that

The key is to understand if there should be a messaging channel for webview. Anyone knows about this use cases?

@kristoferbaxter @alanorozco @dvoytenko