OrJDev / create-jd-app

The quickest and most efficient way to start new full stack, type safed Solid web app
671 stars 26 forks source link

query client should not be shared between requests #119

Closed shiro closed 8 months ago

shiro commented 8 months ago

As far as I'm aware, sharing an instance of QueryClient could result in leaking of user-specific data to other requests, since the cache is shared (correct me if I'm wrong).

The official tanstack example also re-creates the client on every request.

Suggested fix: update src/app.tsx to:

export default function App() {
  const queryClient = new QueryClient({
    // ...
  });

  // ...
}
OrJDev commented 8 months ago

As far as I'm aware, sharing an instance of QueryClient could result in leaking of user-specific data to other requests, since the cache is shared (correct me if I'm wrong).

The official tanstack example also re-creates the client on every request.

Suggested fix: update src/app.tsx to:


export default function App() {

  const queryClient = new QueryClient({

    // ...

  });

  // ...

}

Thank you for this, ye i think we should use whatever is being recommended by tanstack, if you want to make a pr go ahead if not i will make one once im available to.

OrJDev commented 8 months ago

fixed in https://github.com/OrJDev/create-jd-app/commit/97c93290ecf8c3fc25cc87b2247229c816ae7e57