Skip to content

feat(frontend): logs uplift#4504

Merged
jog1t merged 1 commit intomainfrom
03-25-feat_frontend_logs_uplift
Apr 15, 2026
Merged

feat(frontend): logs uplift#4504
jog1t merged 1 commit intomainfrom
03-25-feat_frontend_logs_uplift

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented Mar 25, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

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

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

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
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4504 March 25, 2026 01:18 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 25, 2026

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

Service Status Web Updated (UTC)
ladle ❌ Build Failed (View Logs) Web Apr 15, 2026 at 3:05 pm
kitchen-sink ❌ Build Failed (View Logs) Web Apr 15, 2026 at 3:05 pm
frontend-inspector 🕒 Building (View Logs) Web Apr 15, 2026 at 3:05 pm
website 🕒 Building (View Logs) Web Apr 15, 2026 at 3:05 pm
frontend-cloud 🕒 Building (View Logs) Web Apr 15, 2026 at 3:05 pm
mcp-hub ✅ Success (View Logs) Web Mar 25, 2026 at 1:19 am

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

jog1t commented 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): logs uplift

Overview

This PR adds real-time SSE log streaming to the frontend with a new /logs route, a DeploymentLogs component with virtual scrolling, and a new "Logs" tab in actor details. The bulk of the diff is deletion of a large generated icon bundle (dist/index.gen.js), replaced by a slimmer import.


Critical Bugs

1. useDeploymentLogsStream called without required project and namespace

The hook signature requires both as non-optional strings, but DeploymentLogsProps does not include them and they are not sourced from context inside the component. Both call sites pass neither:

  • actors-actor-details.tsx:296<DeploymentLogs pool="default" filter={...} /> (no project/namespace)
  • logs.tsx:180 — passes namespace but it is not in the prop interface (TS error), and never passes project

The SSE stream will fail to connect for every render.

2. Missing return values from useDeploymentLogsStream

deployment-logs.tsx destructures four fields that the hook does not return. The hook returns only { logs, isLoading, error }, but the component also destructures streamError, isLoadingMore, hasMore, and loadMoreHistory. As a result: the error banner never shows, the sentinel row and load-more trigger are permanently disabled, and calling loadMoreHistory would crash if the guard ever passes.

3. Type mismatch: SSE log events vs. history log items

The hook stores RivetSse.LogStreamEvent.Log[] (raw SSE event objects), but LogRow expects Rivet.LogHistoryResponseItem and accesses entry.timestamp, entry.region, entry.message directly. Meanwhile logs.tsx:76 accesses e.data.timestamp, e.data.region, e.data.message, confirming the SSE event wraps its payload in a .data field. LogRow will render undefined for all displayed fields.

4. logsRef type incompatibility

logs.tsx:69 declares logsRef as RivetSse.LogStreamEvent.Log[], but DeploymentLogsProps.logsRef is typed Rivet.LogHistoryResponseItem[]. The component assigns logs (SSE events) into logsRef.current. The getLogsText() callback accesses e.data.* while the prop type expects flat properties — TypeScript error and runtime mismatch.


High Severity Issues

5. ActorTabsNotRunning exposes the "Logs" tab unconditionally

When an actor is not running, ActorTabsWithId delegates to ActorTabsNotRunning, which passes hiddenTabs={new Set()}. The "Logs" tab therefore appears for all users regardless of app type or managed pool existence. It should apply the same guard as the running path (__APP_TYPE__ !== "cloud" || !hasManagedPool).

6. deployment-logs tab does not check guardContent (actors-actor-details.tsx:295-297)

Every other TabsContent in ActorTabsShell checks guardContent before rendering. The new logs tab does not, which attempts to start an SSE stream even when the inspector guard is blocking access.


Medium Issues

7. items.reverse() mutates the API response array (cloud-data-provider.tsx:118)

return items.reverse() mutates the array in place. Use return [...items].reverse() instead.

8. logsHistoryInfiniteQueryOptions and currentNamespaceLogsHistoryInfiniteQueryOptions appear unused

Both new query options are wired into the data provider but not consumed by any component in this PR. If they are planned for a follow-up, that should be noted.


Minor Notes

  • SKELETON_KEYS is a 40-element manually-written array; Array.from({ length: 40 }, (_, i) => String(i)) is simpler.
  • The scroll-restoration comment hardcodes +1 where sentinelOffset should be referenced for clarity.
  • logs.tsx:120 has a tab character embedded in a Tailwind class string that looks like an accidental artifact.

Summary

The PR is not yet mergeable. The SSE stream will never connect due to missing project/namespace, and even if it did, LogRow would render blank fields due to the type mismatch between raw SSE event objects and the flat LogHistoryResponseItem shape expected by the UI.

🤖 Generated by Claude Code

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

jog1t commented Mar 26, 2026

Merge activity

  • Mar 26, 2:44 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 26, 2:45 AM UTC: Graphite couldn't merge this pull request because a downstack PR refactor: uplift metrics #4499 failed to merge.
  • Apr 15, 3:02 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 15, 3:05 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 15, 3:06 PM UTC: @jog1t merged this pull request with Graphite.

@jog1t jog1t mentioned this pull request Apr 6, 2026
11 tasks
@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 force-pushed the 03-25-feat_frontend_logs_uplift branch from bf0b762 to 11d30a2 Compare April 14, 2026 19:44
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4504 April 14, 2026 19:44 Destroyed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4504

All packages published as 0.0.0-pr.4504.1a0835a with tag pr-4504.

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-1a0835a
docker pull rivetdev/engine:full-1a0835a
Individual packages
npm install rivetkit@pr-4504
npm install @rivetkit/react@pr-4504
npm install @rivetkit/rivetkit-native@pr-4504
npm install @rivetkit/sqlite-wasm@pr-4504
npm install @rivetkit/workflow-engine@pr-4504

@jog1t jog1t changed the base branch from 03-24-feat_frontend_bring_back_the_rivet_compute to graphite-base/4504 April 15, 2026 14:35
@jog1t jog1t force-pushed the 03-25-feat_frontend_logs_uplift branch from 11d30a2 to e163dd3 Compare April 15, 2026 14:36
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4504 April 15, 2026 14:36 Destroyed
@jog1t jog1t changed the base branch from graphite-base/4504 to 03-24-refactor_uplift_metrics April 15, 2026 14:36
@jog1t jog1t mentioned this pull request Apr 15, 2026
11 tasks
@jog1t jog1t changed the base branch from 03-24-refactor_uplift_metrics to graphite-base/4504 April 15, 2026 15:03
@jog1t jog1t changed the base branch from graphite-base/4504 to main April 15, 2026 15:03
@jog1t jog1t force-pushed the 03-25-feat_frontend_logs_uplift branch from e163dd3 to a4275a0 Compare April 15, 2026 15:04
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4504 April 15, 2026 15:05 Destroyed
@jog1t jog1t merged commit 5337ed1 into main Apr 15, 2026
22 of 32 checks passed
@jog1t jog1t deleted the 03-25-feat_frontend_logs_uplift branch April 15, 2026 15:06
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