GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — refactor(react-query): hoist every staleTime into a named exported constant by waleedlatif1 · Pull Request #5427 · simstudioai/sim Conversation
Collaborator
Summary
Type of Change
Testing
Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
…nstant Adds a repo-wide convention (documented in .claude/rules/sim-queries.md, CLAUDE.md, and the react-query-best-practices skill/command) that every staleTime value must come from a named exported constant instead of an inline numeric literal. This prevents a server-side prefetch and its client hook from independently duplicating the same duration and drifting out of sync, which Greptile caught on PR #5426. Applies the convention across all of hooks/queries/** and their prefetch.ts consumers.
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
PR SummaryLow Risk Overview The rule is documented in No numeric Reviewed by Cursor Bugbot for commit 661efac. Configure here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThis PR mechanically hoists every inline
Confidence Score: 5/5Pure rename/hoist refactor — no numeric values changed, no behavior change, TypeScript clean, client-boundary check passes. Every changed line is a mechanical substitution of an inline literal with its newly-named constant; no query logic, fetch functions, or cache keys were touched. The tricky TABLE_LIST_STALE_TIME split across the client-boundary is handled correctly. The only residual gap is a handful of component files outside the stated scope that still carry inline literals duplicating the new constants, but that does not affect correctness of the change itself. logs.tsx and knowledge-base-selector.tsx still carry inline staleTime literals that duplicate the new constants — worth a follow-up pass to extend the convention outside hooks/queries. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["hooks/queries/entity.ts\n(no 'use client')"] -->|"exports"| B["ENTITY_LIST_STALE_TIME = 60 * 1000"]
A -->|"exports"| C["useEntityList hook"]
B -->|"staleTime: ENTITY_LIST_STALE_TIME"| C
D["app/.../prefetch.ts\n(server-side)"] -->|"imports"| B
D -->|"staleTime: ENTITY_LIST_STALE_TIME"| E["queryClient.prefetchQuery"]
subgraph special ["Client-boundary exception: tables"]
F["hooks/queries/tables.ts\n('use client')"] -->|"imports TABLE_LIST_STALE_TIME"| G
G["hooks/queries/utils/table-keys.ts\n(no 'use client')\nexports TABLE_LIST_STALE_TIME"]
H["app/.../tables/prefetch.ts\n(server-side)"] -->|"imports TABLE_LIST_STALE_TIME"| G
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["hooks/queries/entity.ts\n(no 'use client')"] -->|"exports"| B["ENTITY_LIST_STALE_TIME = 60 * 1000"]
A -->|"exports"| C["useEntityList hook"]
B -->|"staleTime: ENTITY_LIST_STALE_TIME"| C
D["app/.../prefetch.ts\n(server-side)"] -->|"imports"| B
D -->|"staleTime: ENTITY_LIST_STALE_TIME"| E["queryClient.prefetchQuery"]
subgraph special ["Client-boundary exception: tables"]
F["hooks/queries/tables.ts\n('use client')"] -->|"imports TABLE_LIST_STALE_TIME"| G
G["hooks/queries/utils/table-keys.ts\n(no 'use client')\nexports TABLE_LIST_STALE_TIME"]
H["app/.../tables/prefetch.ts\n(server-side)"] -->|"imports TABLE_LIST_STALE_TIME"| G
end
Reviews (3): Last reviewed commit: "refactor(react-query): use FOLDER_LIST_S..." | Re-trigger Greptile |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 29090e5. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
useFolders and useFolderMap still used inline 60 * 1000 despite folders.ts already exporting FOLDER_LIST_STALE_TIME — the same prefetch-drift gap this refactor closes everywhere else. Same value, no behavior change.
|
Addressed the folders.ts finding in 661efac — |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 661efac. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
661efac3
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.