Skip to content

fix: poll templates list while open#450

Draft
Kraci wants to merge 1 commit into
mainfrom
templates-page-does-not-refresh-after-builds-finish-en-79
Draft

fix: poll templates list while open#450
Kraci wants to merge 1 commit into
mainfrom
templates-page-does-not-refresh-after-builds-finish-en-79

Conversation

@Kraci

@Kraci Kraci commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Poll templates list while open

@Kraci Kraci self-assigned this Jun 23, 2026
@cla-bot cla-bot Bot added the cla-signed label Jun 23, 2026
@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

EN-79

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 23, 2026 2:39pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2f09f2e36

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined,
initialCursor: undefined,
placeholderData: keepPreviousData,
refetchInterval: TEMPLATES_REFETCH_INTERVAL_MS,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid polling every cached infinite page

When a team has enough templates for table-body.tsx to auto-load multiple pages, this interval makes TanStack's infinite query refetch every cached page every 15 seconds. Because this query has no maxPages cap or reset like the builds table, a user who has scrolled through 20 pages now generates 20 /templates requests per tick just by leaving the tab focused, so the polling cost grows with scroll depth and can hammer the API; consider capping cached pages or polling only the first page/list invalidation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Kraci check this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants