query icon indicating copy to clipboard operation
query copied to clipboard

perf(query-core): clear query's revertState once fetching ends successfully

Open LoicDavid opened this issue 8 months ago • 0 comments

The #revertState attribute of the Query class is used as a fallback for fetching failure. Clearing it once fetching ends successfully improve memory usage, particularly with queries returning large amount of data.

More context in this discussion: https://github.com/TanStack/query/discussions/9264

NB: I didn't add unit tests for this modification. Indeed, as #revertState is a hash private attribute, I see no way to access it in unit tests to check if it is properly reset.

LoicDavid avatar Jun 10 '25 18:06 LoicDavid