-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: provider state check #603
Conversation
I think I like this as an idea, and maybe we could add a |
@liran2000 there are other provider states as well (ERROR) for instance, and STALE is added in v0.7.0. I don't think STALE is a problem for this idea - but if we're going to automatically check this state, should we check for the ERROR state as well? That seems difficult because we don't know the nature of the error. It seems inconsistent for the SDK to handle the one and not the other. What do you think? @Kavindu-Dodan @lukas-reining @beeme1mr what do you guys think about this as a concept? |
The way I see the spec section |
That's definitely the way the spec is currently written. I wanted to suggest we think about whether the spec might be enhanced here. I think I am leaning towards no, for the reasons already mentioned - but I agree it's tedious for the provider to handle this on it's own. We could add this as a behavior in the |
Error state is handled by going to GeneralError, but yes, ERROR and STALE can be added to the code in a possibly adjusted way. I will try to emphasize again the need for this, you can share if something is not accurate.
This create 2 problems:
This solution comes to solve these problems. Possible down side of the solution is to have less control of flow on these states, so I understand the conflict here. Do you possibly have some other ideas for these problems ? |
I totally agree this is not ideal, and there is a lot I like about this proposal. I would like a solution, but the solution can't introduce more problems, and I'm worried this one might (but I'm not sure).
Yes. The problem I see is that we also need to handle ERROR state to be consistent - but if we do that, how can the provider give more details about the error? If the SDK just throws Basically, the more logic we move into the SDK, the less providers have to implement (good), but the less control we give providers (bad). Striking this balance is hard. |
I'm closing this for now. I'm totally willing to revive this discussion, but I think we want to leave it out for the time being. |
According to the spec:
Problem:
Provider state check is implemented per provider.
Solution:
Provider state check is implemented at core SDK.
Notes
May be considered as some "behavior change", as in case of provider not ready, error is thrown, and hooks are not called, which is similar behavior to other errors handling.
@toddbaert @Kavindu-Dodan @thomaspoignant