-
Notifications
You must be signed in to change notification settings - Fork 29.9k
[use-cache] track cache read earlier when encrypting bound args #81427
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
Conversation
|
|
||
| async function getUncachedData() { | ||
| await setTimeout(100) | ||
| await setTimeout(0) |
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.
restoring these back to their intended timeout. Suspect that a prior fix to module loading tracking in dev made this possible
|
|
||
| async function fetchUncachedData() { | ||
| await setTimeout(100) | ||
| await setTimeout(0) |
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.
restoring these back to their intended timeout. Suspect that a prior fix to module loading tracking in dev made this possible
Tests Passed |
bound args need to be encrypted for use cache functions and currently we track the read slightly later than will be necessary when we sync the latest React. This change moves the tracking to be as early as possible (as soon as the input signal is aborted or when the bound args are finished being serialized, whichever is first).
| // missing this cache fill. We use a idempotent function to only start reading once because | ||
| // it's also possible that streamToString finishes before the hangingInputAbortSignal aborts. |
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.
The comment has a minor grammatical error: "a idempotent function" should be "an idempotent function" since "idempotent" begins with a vowel sound.
| // missing this cache fill. We use a idempotent function to only start reading once because | |
| // it's also possible that streamToString finishes before the hangingInputAbortSignal aborts. | |
| // missing this cache fill. We use an idempotent function to only start reading once because | |
| // it's also possible that streamToString finishes before the hangingInputAbortSignal aborts. |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
bound args need to be encrypted for use cache functions and currently we track the read slightly later than will be necessary when we sync the latest React. This change moves the tracking to be as early as possible (as soon as the input signal is aborted or when the bound args are finished being serialized, whichever is first).
bound args need to be encrypted for use cache functions and currently we track the read slightly later than will be necessary when we sync the latest React. This change moves the tracking to be as early as possible (as soon as the input signal is aborted or when the bound args are finished being serialized, whichever is first).