You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing staleTime (and gcTime) on the new query options
Every other polling/refetch query in this file that uses refetchInterval also sets staleTime (and usually gcTime). The new currentProjectFirstImagePresentQueryOptions sets only refetchInterval: 5000 with no staleTime. Without it, React Query treats the cached value as immediately stale on every mount, triggering a background refetch even when data is fresh from a moment ago. Recommend adding staleTime: 4000 (just under the poll cadence) and gcTime: 5 * 60 * 1000 to match the file's existing convention.
Query key structure differs from the sibling
currentProjectImagesQueryOptions stores the org/project inside an opts object as [opts, "images"], following the file's general keying convention. The new currentProjectFirstImagePresentQueryOptions uses a flat array [organization, project, "images", "first-present"]. This inconsistency means React Query cannot share or correctly invalidate the two keys together. Recommend using the same structural pattern, e.g. [{ organization, project }, "images", "first-present"] — or confirming the independence is intentional and adding a brief comment.
Comment describes what, not why
The block comment before currentProjectFirstImagePresentQueryOptions re-describes what the function name and refetchInterval already make obvious. Per the repo's conventions, comments should capture non-obvious constraints or invariants. The one detail worth preserving is why this is a separate query key from currentProjectImagesQueryOptions (dedicated polling interval, returns a boolean). Everything else can be removed.
frontend/src/app/getting-started.tsx
Brief flash of wrong message on initial render
When enabled is true but the first fetch has not yet resolved, hasImage is undefined. Because undefined !== true is true, the component renders "Waiting for your first deployment..." before it has confirmed no image exists. A user who already has images will briefly see the wrong message before the query returns. Adding placeholderData: false (or an isLoading guard) would default the initial render to the correct copy.
Noop fallback object recreated on every render
The inline object { queryKey: ["frontend-setup", "first-image-noop"] as const, queryFn: () => false } is constructed fresh on each render pass. While React Query does stable-compare query keys, the queryFn function reference changes every render. Extract this to a module-level constant so object identity is stable:
provider and hasConfiguredDatacenter both walk the same three-level runnerConfigs -> datacenters nesting and call deriveProviderFromMetadata. A single pass is cleaner and avoids diverging if the logic ever changes:
constallDcProviders=(runnerConfigs?.pages??[]).flatMap((page)=>Object.values(page.runnerConfigs).flatMap((config)=>Object.values(config.datacenters).map((dc)=>deriveProviderFromMetadata(dc.metadata),),),).filter((p): p is string=>p!==undefined);constprovider=allDcProviders[0];consthasConfiguredDatacenter=allDcProviders.length>0;
Asymmetric paging logic
hasRunnerNames only looks at pages[0], while hasConfiguredDatacenter uses .some(page => ...) across all pages. If both are meant to be exhaustive checks, hasRunnerNames should also iterate all pages.
Overall
The core logic is sound. Gating hasBackendConfigured on metadata.provider presence is a clear improvement over the previous any-config check that would incorrectly advance users past the onboarding step when a compute pool existed but was not yet provider-tagged. The image-polling hook correctly short-circuits to a no-op in non-cloud builds via the features.compute gate.
The items most likely to affect runtime behavior: the missing staleTime on the new polling query, the initial-render flash showing the wrong message for users who already have images, and the paging asymmetry in hasRunnerNames.
jog1t
changed the base branch from
05-26-fix_frontend_align_log_region_column_and_disable_selection_on_metadata
to
graphite-base/5106May 26, 2026 22:30
jog1t
deleted the
05-27-refactor_frontend_modify_onboarding_for_rivet_compute
branch
May 26, 2026 22:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: