You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If authBarrier is created following this guide https://ff.effector.dev/recipes/auth_token.html
and there is no option to know the expiration date for a token => token refresh is triggered by queries returning 401 status
Query is triggered - returns 401 because of expired token
Query's $data is dropped and $error is updated - it is a correct behavior, because it is a latest response
Barrier is triggered, token is refreshed
Query is re-triggered, now returns 200
Everything in this flow is correct in itself, but is also annoying to the end user:
Because of intermediate $data and $error updates UI will flicker, even though technically user does not care about this error-state, if it will go away the next moment, once token is updated
One option to fix that is to use separate, userland-created Stores for $data and $error, while abandoning the original Query's ones - but it is an annoying DX
Expectation
There is a more DX-friendly way to handle that situation, without sacrificing the query.$data and query.$error
Might be something similiar to retry's suppressIntermediateErrors 🤔
The text was updated successfully, but these errors were encountered:
Problem
If
authBarrier
is created following this guidehttps://ff.effector.dev/recipes/auth_token.html
and there is no option to know the expiration date for a token => token refresh is triggered by queries returning 401 status
Then following problem is happening
401
because of expired token$data
is dropped and$error
is updated - it is a correct behavior, because it is a latest response200
Everything in this flow is correct in itself, but is also annoying to the end user:
Because of intermediate
$data
and$error
updates UI will flicker, even though technically user does not care about this error-state, if it will go away the next moment, once token is updatedOne option to fix that is to use separate, userland-created Stores for
$data
and$error
, while abandoning the original Query's ones - but it is an annoying DXExpectation
There is a more DX-friendly way to handle that situation, without sacrificing the
query.$data
andquery.$error
Might be something similiar to
retry
'ssuppressIntermediateErrors
🤔The text was updated successfully, but these errors were encountered: