Skip to content

calling resetApiState while a request is running will not re-initiate it since 1.9.0 changes #2920

@samallisonds

Description

@samallisonds

I have some async custom queries that were working in 1.8.6, but no longer work in 1.9.0.

The useQuery result is no longer being updated after the async operation completes. Simply reverting to 1.8.6 fixes it immediately.

I notice the tests for this area don't actually have anything to wait for. Perhaps a simple test with a Promise resolving after a short setTimeout might help. Sorry about the lack of real code, all I have is pretty involved. I suspect it is quite simple to reproduce? Hopefully the below helps....

const queryFnWithPromise = () => {
  return new Promise<{ data: string }>((resolve) => {
    setTimeout(async () => {
      resolve({data: 'foo'})
    }, 1)
  })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions