Skip to content
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

[JENKINS-73592] refresh buildhistory widget when tab was hidden before #9605

Closed
wants to merge 1 commit into from

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Aug 13, 2024

The current implementation of the load method exits early when the document is hidden to avoid unnecessary calls to the backend. But this avoids that the refreshTimeout is properly (re-)created.
This leads to 2 effects:

  • when opening a job page in a new tab (ctrl+click) from a list view and then switching to the tab that the history widget is empty.
  • after switching to another tab and then coming back to the job tab, the history no longer refreshes itself (See the Jira for reproduction steps)

See JENKINS-73592.

Testing done

Manual verified with the mentioned steps above that history widget is properly updated.

Proposed changelog entries

  • refresh buildhistory widget when tab was hidden before

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

@NotMyFault NotMyFault requested a review from a team August 13, 2024 05:30
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 13, 2024
@timja timja added the bug For changelog: Minor bug. Will be listed after features label Aug 13, 2024
@@ -30,6 +30,9 @@ function load(options = {}) {

// Avoid fetching if the page isn't active
if (document.hidden) {
if (buildHistoryPage.dataset.pageHasUp === "false") {
Copy link
Member

@daniel-beck daniel-beck Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the relevance of this condition?

It seems that the second problem (switching tabs) would still remain if I page through the build history first?

Is this just making this change consistent with a pre-existing bug? In testing it seems I'm not getting AJAX refreshes on page 2 of the widget.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed when you're not on the first page of the build history and there is a running build, this will never get updated (independent of this change).
But that behaviour can also be seen on 2.462.x and earlier. So this is a long standing bug/limitation.

@mawinter69 mawinter69 changed the title [JENKINS-73592] refresh buildhistory widget in all cases [JENKINS-73592] refresh buildhistory widget after page gets focus Aug 13, 2024
@mawinter69 mawinter69 changed the title [JENKINS-73592] refresh buildhistory widget after page gets focus [JENKINS-73592] refresh buildhistory widget when tab was hidden before Aug 13, 2024
@mawinter69
Copy link
Contributor Author

replaced by #9624

@mawinter69 mawinter69 closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants