-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
amp-list on shadow-dom doesn't render mustache template #21902
Comments
Hi @iwoak. Does this always happen? I have not been able to reproduce in Chrome/Safari/Firefox both comment and rating sections show up fine for me with 1904091426070 ( I am testing by going to https://rep.repubblica.it/pwa/generale/2019/04/17/news/iva_tria_non_esclude_i_rincari_lega_e_5_stelle_mai_con_noi_-224316802/ ) Also note that 1904091426070 went to production April 15 |
/cc @prateekbh |
The only time I was able to repro this was In that case, I got the following errors from the service-worker:
upon next refresh, everything worked and no Any chance your service-worker updated around that time frame? I can see |
Hi @aghassemi and thanks for your replies, but I still see the problem and I can replicate it in both way (visiting directly detail page or navigate from home page). I don't receive any error from service-worker :( |
@iwoak Thanks, how often does this repro for you? (like, how many times after refreshing) I still haven't been able to hit it. Using Firefox 66 I get the following everytime i refresh There likely is some sort of a race condition here. Only recent change related to |
Chatted with @prateekbh, he will take a look. I doubt that this is new but recent changes may have caused the race to be more common. I still haven't been able to repro more than couple of times. |
I'm able to reproduce the problem on Chrome at every hit of this page: while on the plain AMP page everything is working as expected: |
Hi @justforfun, while we are trying to figure out the race condition can you please verify that the same happens for you if the service worker is not registered or is bypassed by devtools. |
Hi @prateekbh, both me and @justforfun has the same problem even with SW not registered or bypassed. |
Thanks this helps us narrow down the problem 🙂 |
I remember debugging a similar sort of issue with shadow DOM and I did make a change to fix that portion (#17896), but it could still be a problem or something similar (perhaps the wrong amp doc is being used somewhere). Could also try the |
Hi @sparhami I have this problem every time so I could debug if you write me some instructions. |
I found an elaboration difference from amp pure page and amp in shadow dom:
Another information: I have different connection lines here, with my developer line I have the problem every time (more or less 300mb), but if i plug my laptop to lan for visitors in a meeting room everything works fine (approximately 50mb) |
Sorry I think I might have had that backwards. I think this may be fine. |
just adding @choumx @dvoytenko if they have any idea |
@sparhami, what do you think about this?
|
Hi all, I can confirm that the SW "service-worker.js:1 Uncaught (in promise) DOMException" errors because of Quota Errors are unrelated as I can get the Comments to work with the DOMException error there. I've noticed that the error occurs 100% when this error is visible from the Console:
blob:https://rep.repubblica.it/8a96ddc0-0b73-4f68-b721-2b3b1b8fc296 Steps to reproduce constantly:
|
Will use this today to dig deeper today |
Confirmed: I can reproduce this in an incognito window using the steps mentioned in: #21902 (comment) |
The stacktrace i am getting is pointing to https://github.com/ampproject/amphtml/pull/21687/files#diff-a244d3899d7cb3930087a9d566a46af9R259 Which should be fixed with #21976,I'll re-check tomorrow with the dev channel once the opt-in is rolled out |
@gilbertococchi the dev channel fix will be available today, will update the thread once I check it. If there are any more errors they are definitely masked by this thus waiting for this fix. Also the |
Hi I tested this with canary: https://cdn.ampproject.org/rtv/001904301721170/shadow-v0.js with a custom redirect and seems like it fixes the problem. The canary will be available as an opt-in tomorrow and you should be able to check with it as well. If everything works i'll continue adding tests around this. |
Hi I just tested with the dev channel and it seems to be working for me with the above steps. Can you please check and revert |
Hi @prateekbh with the dev channel it works fine even for me. Thanks a lot! |
I guess I can get this cherry-picked for you today :) |
Hi @iwoak We did a cherry pick of a suspected change whose fix is available in production now. But I can still the issue. I'll try to look for any other suspects. The complete canary will reach production on Tuesday, but will try to ask if this can be done any sooner. |
// @cathyxz |
I still see the issue too, but thanks a lot @prateekbh for cherry pick! |
@prateekbh (and CC: @iwoak ) Based on these comments:
... the issue sounds directly related to #17532 . If this is the case, it can be remedied in one of two ways:
|
So @prateekbh figured out that 1904091426070 was the release that broke it and our new dev channel contains changes that fix it. A breakpoints indicate that the main difference here (to
amphtml/extensions/amp-bind/0.1/bind-impl.js Lines 383 to 389 in 84a002d
In the Fast 3G case where the bug repros, a breakpoint on L387 at If I may venture a hypothesis, the most closely related PR that might cause this from release 1904091426070 was #21763 (which adds a wait to |
// @choumx as he might have better idea |
Cathy was on the right track. The problem is there are actually two shadow AMP docs on this page: (1) the main article and (2) a subscriptions widget in the top right corner. Both of these shadow docs use amp-bind, but amp-bind's worker is only scoped to support 1 doc per window. This is the cause of the worker console error -- the second doc's amp-bind initialization always fails (before the fix in canary). So the race is actually "which page gets initialized first". If the article doc happens to be initialized after the subscriptions, then the initialization promise never resolves. This means amp-list render gets stuck waiting for amp-bind to rescan. The "fix" in canary just ignores this error and overwrites the existing worker state. This likely breaks amp-bind functionality somewhere, but it does allow the promise to resolve. :) The long-term fix should be to (A) support multiple docs in amp-bind's worker and (B) make cross-extension APIs more resilient (promise timeouts etc.) and (C) fix error logging in web worker. Happy to spend some cycles on this next week. |
Thanks a lot @prateekbh and @choumx! the problem is very clear now. |
thanks a lot, now all works fine online for us on rep.repubblica.it. Until the long-term fix is published maybe you could put a note on the documentation about only one shadow amp tip. |
What's the issue?
amp-list on shadow-dom doesn't render mustache template from yesterday (17 April)
How do we reproduce the issue?
You can visit every ours detail article page on https://rep.repubblica.it for example https://rep.repubblica.it/pwa/intervista/2019/04/17/news/orlando_il_ministro_sappia_che_non_mi_faro_scavalcare_sono_pronto_a_denunciarlo_-224314656/ and you can look for vote and comments info and links at the right of "condividi" (share) link
If you visit pure amp page at this url https://rep.repubblica.it/ws/detail/intervista/2019/04/17/news/orlando_il_ministro_sappia_che_non_mi_faro_scavalcare_sono_pronto_a_denunciarlo_-224314656/ and all works fine
Ours rest json services linked on src attribute at amp-list works fine and response with data and 200 http code.
What browsers are affected?
Chrome, Firefox, Safari
Which AMP version is affected?
1904091426070
The text was updated successfully, but these errors were encountered: