Skip to content

🐛 Fix amp-list race condition#25964

Merged
dreamofabear merged 10 commits intoampproject:masterfrom
samouri:fix-amp-list-race
Jan 3, 2020
Merged

🐛 Fix amp-list race condition#25964
dreamofabear merged 10 commits intoampproject:masterfrom
samouri:fix-amp-list-race

Conversation

@samouri
Copy link
Copy Markdown
Member

@samouri samouri commented Dec 10, 2019

summary
Addresses #25961

Adds a check that the src has not changed while the xhr was inflight. If the src has changed, then bail instead of scheduling a render. I've added a test that previously would have resulted in two renders and now instead only has one.

cc @jridgewell / @choumx

@samouri
Copy link
Copy Markdown
Member Author

samouri commented Dec 16, 2019

@choumx / @jridgewell: 🏓

@dreamofabear dreamofabear merged commit 8f679ea into ampproject:master Jan 3, 2020
@samouri samouri deleted the fix-amp-list-race branch January 3, 2020 18:58
sparhami pushed a commit to sparhami/amphtml that referenced this pull request Jan 3, 2020
* amp-list: bail out of rendering updates if the src has changed in the meantime

* Add test

* add test

* more specific test

* remove only

* no need to return promise (jridgewell)

* cleaner test case with a more explicit wait

* remove Promise again

* whitespace

* lint
@samouri samouri mentioned this pull request Mar 23, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants