energywebfoundation / iam-client-lib

TypeScript library to be used within decentralised applications for authentication and authorisation using DIDs (Decentralised Identifiers) and VCs (Verifiable Credentials)
GNU General Public License v3.0
19 stars 9 forks source link

chore: refactor cache client auth flow #589

Closed Harasz closed 2 years ago

Harasz commented 2 years ago

Description

Contributor checklist

Harasz commented 2 years ago

It does not matter in my opinion. The execution of the failed request is manged by the code itself. We are operating in the same context of the promise. So if we have something like this

await update(1);
await update(2);

and update 1 will fail, it will try to run it 3 times and eventually it will fail, but update 2 will not execute, bc first update throw an error. So from the code perspective its the same promise that needs to be fulfilled.

@jrhender

Harasz commented 2 years ago

@JGiter hymm, it would be great, but i dont think it's possible :/

artursudnik commented 2 years ago

Have you considered using Axios interceptor to implement retrying failed requests?

Harasz commented 2 years ago

@artursudnik request interceptor is only accepting axios config, so i can't override promise there. I can use response interceptor and catch errors, but it's not an ideal approach in my opinion.

ewf-devops commented 2 years ago

:tada: This PR is included in version 6.0.0-alpha.29 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

ewf-devops commented 2 years ago

:tada: This PR is included in version 6.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: