summary
When hooking up amp-bind with amp-list where we mutate the bound [src] attribute, it is possible to enter a race condition where the rendered items are for the previous state.
Imagine a shopping cart with categories for women's/mens clothing:
- Default page to land on is women's clothing, and this endpoint takes 1s to resolve.
- User quickly clicks a the tab for men's clothing, and this only takes 200ms.
It is possible that the promise for loading data from (1) will end up resolving after (2). This leads to the jarring UX of having "Men" selected and yet seeing Women's clothing.
One can reproduce this in AMP Camp: https://camp.samples.amp.dev/product-listing?gender=women&category=shirts.
cc @choumx @morsssss