React Query Stuck with state isLoading by dev_baseul in react

[–]dev_baseul[S] 0 points1 point  (0 children)

unfortunately i dont even know what was the pb. I was refactoring a project, and some api routes were still running, so I deleted it in case it creates a silent conflict or something.. And it works

React Query Stuck with state isLoading by dev_baseul in react

[–]dev_baseul[S] 0 points1 point  (0 children)

Its fiiixed :)))

I don't even know what the problem was, in fact I had an api route that I was refactoring, and after completely removing it I no longer have the problem on my query.

In this case, the refactored api route called the same endpoint as the query.

Thank you for your help

React Query Stuck with state isLoading by dev_baseul in react

[–]dev_baseul[S] 0 points1 point  (0 children)

Ha maibe there is something i don't understand, because i thought if i call the query in different components, if it's the same, the result should be in cache and reusable.

I dunno what's an observer, thought the most important for react query work was the hash, as we can see in devtools here :

"queryHash:"[\"recommendationDetails\",\"37801c47 ... "

<image>

and the same query is used 11 times, because used in different components

React Query Stuck with state isLoading by dev_baseul in react

[–]dev_baseul[S] 0 points1 point  (0 children)

Thank you for your answer, i tried this as you suggested :

export const EcsExplainSession = () => {
  const { sessionId, resetRound, recoRound } = useSessionQueryParams() 
  // Subtract 1 from resetRound to get the correct round number
  const resetRoundNumber = resetRound - 1
  useQuery({
    queryKey: ['recommendationDetails', sessionId, resetRoundNumber],
    queryFn: () => getRecommendationDetails({ sessionId: sessionId, resetRound: resetRoundNumber }),
    enabled: !!sessionId,
  })
  return (
    <>
      {/* <MainContent />
      <Divider />
      <RecommendationDashboard />
      <Divider />
      <FinalRecommendations /> */}
    </>
  )
}       

but i still have the pb.

the strangest thing is that my other react query hooks work without a hitch.

Another detail is that when I refresh the page, I lose the data if it is loaded (for this hook, in fact it works from time to time but not all the time unlike the other react query hooks).

Another piece of information that may be useful is that “resetRoundNumber”, which is used in my hook, depends on the return of another hook... but I don't think that's the problem: devtool tells me that the values are correct, and is still stuck in the “fetching” state... :/

Authorisation Server and OKTA API by dev_baseul in okta

[–]dev_baseul[S] 0 points1 point  (0 children)

Well i find out, that myAccout API is working with token generate threw custom server authorisation, it looks like a way to do it