chore(site): reduce fetch interval on workspaces page by johnstcn · Pull Request #18725 · coder/coder · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

chore(site): reduce fetch interval on workspaces page #18725

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Jul 2, 2025

Relates to coder/internal#720

The workspaces query fetches a lot of information. We can probably reduce the frequency at which we fetch data by polling less often if no workspace builds are in 'intermediate' states.

@johnstcn johnstcn requested a review from a team July 2, 2025 17:34
@johnstcn johnstcn self-assigned this Jul 2, 2025
@johnstcn johnstcn requested review from jaaydenh and removed request for a team July 2, 2025 17:34
@johnstcn johnstcn requested a review from Copilot July 3, 2025 16:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces the polling frequency on the Workspaces page by dynamically adjusting the refetch interval:

  • Polls every 5s when any workspace build is in an intermediate state, otherwise every 30s.
  • Disables polling on errors and when the tab is inactive.
Comments suppressed due to low confidence (2)

site/src/pages/WorkspacesPage/WorkspacesPage.tsx:80

  • [nitpick] Consider adding unit or integration tests to verify that the polling interval switches correctly based on error states and active build presence.
		refetchInterval: ({ state }) => {

site/src/pages/WorkspacesPage/WorkspacesPage.tsx:85

  • workspace.latest_build may be undefined, causing runtime errors; use optional chaining (e.g., workspace.latest_build?.status) or provide a default value to guard against missing builds.
				const status = workspace.latest_build.status;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.