Open Elson9 opened 1 month ago
I noticed that I only experience this issue the first time I select a Gateway from the list after I log in as a provider. Also, the toast pops up and I can see the URL/title metadata update briefly as well. Any subsequent navigation after refreshing the page or browsing elsewhere in the portal is OK.
This issue can occur in local env (docker compose) as well as dev. It is difficult to reproduce consistently.
I also observe what @timng-bcgov noted re: page title updating and then going back as it was. I didn't see the URL change but maybe my eyes are too slow.
My guess is either: A) some server side content is not readily available so the redirect fails, or B) there is a race condition where the router.push
doesn't occur.
To address B) I tried adding an await
on that in https://github.com/bcgov/api-services-portal/commit/6e1c3f5c90ece01e36747f893a704a409a8d42fc and it seems to be working in detached local dev mode. I will validate with more testing in docker compose
and in dev.
Following the await
change, I could not reproduce the bug in a handful of tests on dev and local docker.
I think we are good so I am going to close. If the bug continues to occur, I will set up a quick automated test to better validate any future fixes.
Still occurs in the current release in test (b902ab05f)
Still not resolved. The problem (which was attempted to resolve in #1146) ties back to NoGatewayRedirect pushing users back to list
.
@Elson9 has suggested a 1 second setTimeout() or sleep() as a last resort.
I think if paired with some sorta visual loading something it might not be so bad. In general people shouldn't end up on a Gateways page without an active gw (except after logging back in).
What is not uncommon is people going from list --> detail so we really need to fix that.
A more polished solution for users logging in to a Gateways page (and being redirected away now) would be to add a query param to reactivate the last Gateway they were using.
It's back! Still need more work on this issue. If you rapidly go Gateways > Gateway detail > Gateway Services (or other subpage), the redirect back to Gateways occurs:
API Services Portal Issue
User Story
As an API Provider, I want to reliably select a Gateway and have it redirect to the detail page every time.
Test Case
ENV
DEV
TEST
PROD
TESTCASE
EXPECTED
ACTUAL
ERROR
Notes