tektoncd / dashboard

A dashboard for Tekton!
Apache License 2.0
868 stars 265 forks source link

Namespace selector keeps jumping back to first alphabetically #3135

Closed rouke-broersma closed 1 year ago

rouke-broersma commented 1 year ago

Expected behavior

I select a namespace, I open a TaskRun, tekton dashboard stays on that namespace.

Actual behaviour

The namespace selector flickers after a few seconds and selects the top namespace alphabetically. When I go back to the TaskRuns main page I now see TaskRuns in the other namespace.

Steps to reproduce the bug

  1. Open TaskRuns overview
  2. Select namespace
  3. Select TaskRun
  4. Wait some seconds
  5. Namespace is changed
  6. Go to TaskRuns overview
  7. See TaskRuns for wrong namespace

Additional info

Product ReadOnly Namespace Version
Dashboard True tekton-pipelines v0.40.0
Pipelines tekton-pipelines v0.52.0
AlanGreene commented 1 year ago

Thanks for reporting this @rouke-broersma. Is this a new install? Was it working before? Do you see the same behaviour with v0.39.0?

In step 5, when the selected namespace in the dropdown changes, do either the URL or the displayed page change?

rouke-broersma commented 1 year ago

Hi @AlanGreene this is not a new install. We just updated to 0.40.0 yesterday and afaik it was happening on 0.39.0 as well. I don't remember seeing this before we used the --namespaces selector but we enabled that with the upgrade to 0.39.0 so it could be either of them.

In step 5 the url does not change and the page also does not change but the UI buttons in the menu do change:

unnamed

unnamed (1)

AlanGreene commented 1 year ago

In step 4: wait some seconds Is the page refreshing or is the websocket connection being closed (potentially due to short connection timeout in your loadbalancer / proxy)?

Check the network tab of your browser dev tools. If this is the case you would see a number of new websocket and fetch requests at the time the dropdown changes, and they would repeat periodically. This information would help to correctly identify the issue.

AlanGreene commented 1 year ago

I have a potential fix in https://github.com/tektoncd/dashboard/pull/3136 It looks like the Dashboard wasn't respecting the namespace in the URL when loading the page if --namespaces was configured. I reproduced the same behaviour you described by simply refreshing the page when viewing a TaskRun / list of TaskRuns.

If you can confirm the additional requests / refresh / reconnect behaviour from my previous comment I'm fairly confident it's the same cause.

rouke-broersma commented 1 year ago

In step 4: wait some seconds Is the page refreshing or is the websocket connection being closed (potentially due to short connection timeout in your loadbalancer / proxy)?

Check the network tab of your browser dev tools. If this is the case you would see a number of new websocket and fetch requests at the time the dropdown changes, and they would repeat periodically. This information would help to correctly identify the issue.

I see this:

image

AlanGreene commented 1 year ago

Thanks for confirming the additional network requests, this does indeed look like a match.

Would you be willing / able to deploy a nightly release to test the fix?

If so I'll get the fix merged and trigger a nightly release shortly. Once we've confirmed it fixes your issue I'll create a 0.40.1 patch release either later today or tomorrow.

rouke-broersma commented 1 year ago

Thanks for confirming the additional network requests, this does indeed look like a match.

Would you be willing / able to deploy a nightly release to test the fix?

If so I'll get the fix merged and trigger a nightly release shortly. Once we've confirmed it fixes your issue I'll create a 0.40.1 patch release either later today or tomorrow.

As long as the nightly image is publicly available I can test it 👌

AlanGreene commented 1 year ago

Here you go, let me know if this resolves the issue for you and I'll kick off the official release.

https://storage.googleapis.com/tekton-releases-nightly/dashboard/previous/v20230928-b351651feb/release.yaml https://storage.googleapis.com/tekton-releases-nightly/dashboard/previous/v20230928-b351651feb/release-full.yaml

rouke-broersma commented 1 year ago

Here you go, let me know if this resolves the issue for you and I'll kick off the official release.

https://storage.googleapis.com/tekton-releases-nightly/dashboard/previous/v20230928-b351651feb/release.yaml https://storage.googleapis.com/tekton-releases-nightly/dashboard/previous/v20230928-b351651feb/release-full.yaml

Nice! This fixes the issue :)

AlanGreene commented 1 year ago

v0.40.1 is available now: https://github.com/tektoncd/dashboard/releases/tag/v0.40.1

Thanks again for reporting this @rouke-broersma