Skip to content

feat(frontend): bring back the rivet compute#4503

Open
jog1t wants to merge 1 commit intographite-base/4503from
03-24-feat_frontend_bring_back_the_rivet_compute
Open

feat(frontend): bring back the rivet compute#4503
jog1t wants to merge 1 commit intographite-base/4503from
03-24-feat_frontend_bring_back_the_rivet_compute

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented Mar 25, 2026

Enable Rivet Cloud deployment option and enhance logs functionality

This change re-enables the Rivet Cloud deployment option in the frontend and significantly improves the deployment logs viewing experience.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Changes Made

Rivet Cloud Deployment Option

  • Uncommented and re-enabled the Rivet Cloud deployment option in the shared data configuration
  • Restored the Rivet Cloud provider card in the getting started flow
  • Updated the Rivet Cloud SDK dependency to the latest version

Enhanced Deployment Logs

  • Replaced real-time streaming-only logs with a hybrid approach that combines historical logs and live streaming
  • Added infinite scrolling to load older log entries when scrolling to the top
  • Implemented proper scroll position restoration after loading historical data
  • Added loading states and sentinel rows for better user experience
  • Enhanced error handling with separate display for stream errors vs query errors
  • Improved log data structure handling to work with both historical and streaming data
  • Added automatic log following behavior that can be toggled by user scroll actions

Technical Improvements

  • Integrated React Query infinite queries for efficient log history management
  • Optimized virtualization performance for large log datasets
  • Added proper cleanup and abort signal handling for streaming connections
  • Implemented retry logic with exponential backoff for connection failures

How Has This Been Tested?

The changes have been tested by:

  • Verifying the Rivet Cloud option appears in deployment provider selection
  • Testing log viewing with both historical data loading and live streaming
  • Confirming scroll behavior works correctly when loading older logs
  • Validating error states display appropriately for both connection and stream errors

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 25, 2026

🚅 Deployed to the rivet-pr-4503 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud ✅ Success (View Logs) Web Apr 16, 2026 at 4:05 am
website 😴 Sleeping (View Logs) Web Apr 15, 2026 at 3:25 pm
kitchen-sink ❌ Build Failed (View Logs) Web Apr 14, 2026 at 7:45 pm
frontend-inspector 😴 Sleeping (View Logs) Web Mar 31, 2026 at 4:45 am
ladle ❌ Build Failed (View Logs) Web Mar 25, 2026 at 1:19 am
mcp-hub ✅ Success (View Logs) Web Mar 25, 2026 at 1:19 am

Copy link
Copy Markdown
Contributor Author

jog1t commented Mar 25, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Mar 25, 2026
@jog1t jog1t marked this pull request as ready for review March 25, 2026 01:18
@claude
Copy link
Copy Markdown

claude bot commented Mar 25, 2026

PR Review: feat(frontend): bring back the rivet compute

Overall this is a solid improvement — switching from local state to React Query infinite cache for log history is the right architectural move, and the hybrid historical+live approach is well-structured. A few issues worth addressing before merge.

Bug: Stream exhaustion is silently swallowed

File: frontend/src/components/use-deployment-logs-stream.ts

After all MAX_RETRIES attempts are consumed, stream() returns with no user feedback. The old streamWithRetry returned "exhausted" and surfaced an error message. The new code drops this — if the network is down or the server is unavailable, the log view goes silent with no indication to the user.

Add a setStreamError call after the retry loop exits:

// after the for loop body
setStreamError("Failed to connect to log stream after multiple attempts.");

Bug: Live SSE events silently dropped before initial history fetch completes

File: frontend/src/components/use-deployment-logs-stream.ts

queryClient.setQueryData(queryKeyRef.current, (prev: RawInfiniteData | undefined) => {
    if (!prev) return prev; // events dropped here
    ...
});

If the SSE stream delivers events before useInfiniteQuery resolves its first page (prev is undefined), those events are silently discarded. The previous implementation used local state so this race did not exist. Consider buffering into pendingRef when prev is undefined and flushing once the query populates.

Minor: Hardcoded limit tightly coupled to pagination condition

File: frontend/src/app/data-providers/cloud-data-provider.tsx

The value 500 is duplicated between the fetch call and getPreviousPageParam. If changed in one place but not the other, pagination silently breaks. Extract to a named constant:

const LOGS_PAGE_SIZE = 500;
// ...
limit: LOGS_PAGE_SIZE,
// ...
getPreviousPageParam: (firstPage) =>
    firstPage.length >= LOGS_PAGE_SIZE ? firstPage[0].timestamp : undefined,

Minor: Stream error banner not cleared on reconnect

File: frontend/src/components/use-deployment-logs-stream.ts

streamError is only cleared when a "log" event arrives. If the stream reconnects after an error event but before any logs come in (e.g., server is idle), the error banner persists even though the connection is healthy. Consider clearing streamError at the start of each new retry attempt instead.


Severity Issue
Bug Stream exhaustion not reported to user
Bug Live SSE events dropped before initial history query resolves
Minor Magic number 500 duplicated between fetch call and pagination guard
Minor Stream error banner persists through successful reconnects

@jog1t jog1t mentioned this pull request Mar 25, 2026
11 tasks
Copy link
Copy Markdown
Contributor Author

jog1t commented Mar 26, 2026

Merge activity

@jog1t jog1t changed the base branch from 03-24-refactor_uplift_metrics to graphite-base/4503 March 26, 2026 02:44
@jog1t jog1t mentioned this pull request Apr 6, 2026
11 tasks
@jog1t jog1t force-pushed the graphite-base/4503 branch from b6d4660 to 9f6c88f Compare April 14, 2026 19:44
@jog1t jog1t force-pushed the 03-24-feat_frontend_bring_back_the_rivet_compute branch from d5a5abb to 162941b Compare April 14, 2026 19:44
@jog1t jog1t changed the base branch from graphite-base/4503 to 03-24-refactor_uplift_metrics April 14, 2026 19:44
@github-actions
Copy link
Copy Markdown
Contributor

Preview packages published to npm

Install with:

npm install rivetkit@pr-4503

All packages published as 0.0.0-pr.4503.539404f with tag pr-4503.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-539404f
docker pull rivetdev/engine:full-539404f
Individual packages
npm install rivetkit@pr-4503
npm install @rivetkit/react@pr-4503
npm install @rivetkit/rivetkit-native@pr-4503
npm install @rivetkit/sqlite-wasm@pr-4503
npm install @rivetkit/workflow-engine@pr-4503

@jog1t jog1t changed the base branch from 03-24-refactor_uplift_metrics to graphite-base/4503 April 15, 2026 14:35
@jog1t jog1t mentioned this pull request Apr 15, 2026
11 tasks
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