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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions war/src/main/js/pages/project/builds-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

createRefreshTimeout();
}
return;
}

Expand Down Expand Up @@ -101,6 +104,7 @@ function updateCardControls(parameters) {

buildHistoryPage.dataset.pageEntryNewest = parameters.pageEntryNewest;
buildHistoryPage.dataset.pageEntryOldest = parameters.pageEntryOldest;
buildHistoryPage.dataset.pageHasUp = parameters.pageHasUp;
}

paginationPrevious.addEventListener("click", () => {
Expand Down
Loading