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
I suspected that it was wrong to define the redirection logic in OrganizationWrapper but now I think I had the confirmation.
Basically the organization wrapper files decides if the user should be redirected to verification or not and so on.
But that component is re-rendered everytime setLoading() is called.
I found out while working on #170 because I need to redirect the user to the credit card verification which is an external link, and in the automated tests I found out the redirection was called twice.
In reality I found out that multiple HTTP requests were being made to the payment URL, which would have very bad consequences in production because it would initiate multiple payments to the payment gateway.
I think we will have to change this part and move most of that logic in each individual component, this also makes it easier to test it.
Making OrganizationWrapper leaner should also have a beneficial effect on rendering performance because less logic will be executed each time setLoading() is called.
@codesankalp what do you think about this? Do you agree? Or is the current way of doing things right?
We can work on this if there's still time as last thing.
The text was updated successfully, but these errors were encountered:
I agree with this, redirection must be handled from the component so that routes defined in the organization wrapper will be more cleaner. Because currently, we check for some conditions and then redirect.
I also face multiple redirections when doing mobile verification, which can also be solved using this.
I will also implement proper routings such as AuthRoute and simple Route which will make it better.
I suspected that it was wrong to define the redirection logic in
OrganizationWrapper
but now I think I had the confirmation.Basically the organization wrapper files decides if the user should be redirected to verification or not and so on.
But that component is re-rendered everytime
setLoading()
is called.I found out while working on #170 because I need to redirect the user to the credit card verification which is an external link, and in the automated tests I found out the redirection was called twice.
In reality I found out that multiple HTTP requests were being made to the payment URL, which would have very bad consequences in production because it would initiate multiple payments to the payment gateway.
I think we will have to change this part and move most of that logic in each individual component, this also makes it easier to test it.
Making OrganizationWrapper leaner should also have a beneficial effect on rendering performance because less logic will be executed each time
setLoading()
is called.@codesankalp what do you think about this? Do you agree? Or is the current way of doing things right?
We can work on this if there's still time as last thing.
The text was updated successfully, but these errors were encountered: