-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Preload: fix e2e test #67497
Preload: fix e2e test #67497
Conversation
Size Change: 0 B Total Size: 1.83 MB ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Going to merge this because it's just fixing a test and adding a simple preload path. |
// There are two separate settings OPTIONS requests. We should fix | ||
// so the one for canUser and getEntityRecord are reused. | ||
'/wp/v2/settings', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should delay the destruction of the preloaded cache by a couple of MS instead of removing it after the first match. Technically, this should help resolve anything in the critical path via cache without "affecting" the PreloadingMiddleware
behavior.
gutenberg/packages/api-fetch/src/middlewares/preloading.js
Lines 53 to 54 in 5c76815
// Unsetting the cache key ensures that the data is only used a single time. | |
delete cache[ method ][ path ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe next idle callback? Still, it doesn't feel like clean solution but it could work for now I guess.
This e2e test keeps failing for me on #67591 and I'm not sure why. It's consistently happening for me though. Any idea why? |
Adding I could get the preload test to fail locally by adding this test block to the top of
Adding
|
What?
I added an e2e test in #67475, but it doesn't seem to work correctly since it's missing some requests.
Why?
It should catch all the requests.
How?
We start recording before page load, then turn off recording when the iframe src is requested.
Testing Instructions
Nothing, you can see that the remaining URLs are now properly recorded. I've also added one more to the preload list that was showing up.
Testing Instructions for Keyboard