You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you provide an asynchronous function to the mutate function, the duration of the Promise does not seem to affect the other processes until it is resolved. isValidating is false for the duration of the Promise, and the automatic refresh intervals still get executed during the remote update.
Expected Behavior
When mutate is called with a data function that returns a Promise, the isValidating should go to true immediately, blocking any scheduled refreshing of the data.
Bug report
Description / Observed Behavior
When you provide an asynchronous function to the
mutate
function, the duration of thePromise
does not seem to affect the other processes until it is resolved.isValidating
isfalse
for the duration of thePromise
, and the automatic refresh intervals still get executed during the remote update.Expected Behavior
When
mutate
is called with adata
function that returns aPromise
, theisValidating
should go to true immediately, blocking any scheduled refreshing of the data.Repro Steps / Code Example
https://codesandbox.io/p/sandbox/ts8qx3 (instructions included in example)
Additional Context
SWR Version 2.2.5
The test suite has tests for local mutations which includes tests for
isValidating
, but the remote mutation tests seem to lack this.The text was updated successfully, but these errors were encountered: