HTTP 401 after app re-install

Hi,
I’m using remix-run template and I have a worker that needs to access to Shopify API.
The first time I download the app there is no problem when worker run.
But the second time when I re-install the app I got a 401 error:
{
“networkStatusCode”: 401,
“message”: “GraphQL Client: Unauthorized”,
“response”: {}
}

To execute the gql query i’m doing:
const{ admin } =await unauthenticated.admin(shop);
And then:
await admin.graphql(

Don’t know if it is important but i’m not deleting the session when i receive the uninstall webhook.

Do you know where does it come from ?

I think i figured out the problem.
If you keep the session when you receive the UNINSTALLED webhook. a.k.a not deleting the shop session row in session table, then when you reinstall the app on the same shop the shopify lib is checking if the session exists and if it exists it is not updating it.
Don’t know if it it related to shopify lib or the shopify postgresql adapter.

I think this is a bad behaviour.
Because in my case user paid a lot to generate what stored in the BDD and i cannot delete all the data based just on the UNINSTALL webhook