[slop]feat(frontend): enable compute, add historical logs#5059
Conversation
PR Review: feat(frontend): enable compute, add historical logsOverviewThis PR re-enables previously-commented-out Rivet Compute features (managed pool tabs, agent instructions button, provider dropdown item, deployments sidebar link) and adds real historical log fetching with a "Back to newest" jump button and frozen-scroll behavior. IssuesHigh PriorityRef mutation during render (concurrent mode hazard) — The if (follow) {
frozenLogsRef.current = logs;
frozenFirstIdRef.current = logs[0]?.data.insertId;
} else if (logs[0]?.data.insertId !== frozenFirstIdRef.current) {
frozenLogsRef.current = logs;
...
}In React concurrent mode, renders can be interrupted and retried with different state. Mutating refs mid-render can leave them in a torn state between attempts. Move this logic into a Timestamp-based pagination cursor — const before = currentLogs.length > 0
? currentLogs[0].data.timestamp
: new Date().toISOString();Multiple entries can share the same timestamp, causing entries to be skipped or duplicated. Use the unique Missing abort signal in
Medium PrioritySilent error swallowing on initial history fetch } catch {
// Non-fatal. The stream will still start.
}This silently drops fetch errors. At minimum, log the error to the console for debuggability. Ideally surface it transiently so developers know the seed fetch failed.
} catch (err) {
console.error("Failed to load historical logs:", err);
}Only console-logged. Call
const loadMoreHistory = useCallback(async () => { ... },
[isLoadingMore, hasMore, project, namespace, pool, filter, region]);
Rules of Hooks violation comment — // biome-ignore lint/correctness/useHookAtTopLevel: guarded by build constant
const provider = useCloudNamespaceDataProvider();
// biome-ignore lint/correctness/useHookAtTopLevel: guarded by build constant
const { data: hasManagedPool } = useSuspenseQuery(...);This only works safely if Low PriorityPR-number-based dependency reference is less stable than a commit hash PR Lock file shows a Tailwind version mismatch The snapshot changed from
const logsRef = useRef(logs);
logsRef.current = logs;Mutating a ref during render is a code-smell. Since Positive Notes
Posted by claude[bot] |
5491fed to
ab5d87d
Compare

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: