-
Couldn't load subscription status.
- Fork 130
fix(fe): redirect engine users to connect page when there's no actors #3269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 10-26-fix_fe_empty_token_it_is_a_valid_token
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Graphite Automations"Test" took an action on this PR • (10/26/25)1 assignee was added to this PR based on Kacper Wojciechowski's automation. |
PR Review: Fix redirect engine users to connect page when there's no actorsOverviewThis PR adds the same redirect logic that exists for the cloud route to the engine route, ensuring engine users are also redirected to the connect page when there are no actors (builds or runner configs). Good consistency improvement! ✅ Positives
🔍 Observations & Suggestions1. Type Definition Location (Minor)The
This would make the dependency relationship clearer and avoid route-to-route imports. Example: // frontend/src/lib/route-utils.ts
import type { QueryClient } from "@tanstack/react-query";
import type { useEngineCompatDataProvider } from "@/components/actors";
export async function shouldDisplayActors(context: {
queryClient: QueryClient;
dataProvider: ReturnType<typeof useEngineCompatDataProvider>;
}) {
// ... existing implementation
}2. Return Value Semantics (Minor)The function returns if (!hasBuilds && !hasRunnerConfigs) {
return undefined; // Why undefined instead of false?
}
return true;Suggestion: Return // If no builds or configs, don't display actors page
if (!hasBuilds && !hasRunnerConfigs) {
return false;
}
return true;3. Error Handling ConsistencyThe function has a catch-all that returns } catch {
return undefined;
}This means any error (network failure, permission issue, etc.) will redirect to the connect page. Consider:
Suggestion: Add minimal logging for production debugging: } catch (error) {
tracing::warn!(?error, "failed to check if actors should display");
return undefined;
}Wait, this is TypeScript, not Rust! 😄 } catch (error) {
console.warn("Failed to check if actors should display", error);
return false;
}4. Missing Test Coverage (Medium Priority)There don't appear to be any tests for:
Suggestion: Add tests for this routing logic to prevent regressions. 5. Fragment Removal (Nitpick)Nice cleanup removing the unnecessary fragment in frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace/index.tsx:73-74! However, the engine route still has a fragment wrapper (line 30-39 in the new version). Consider applying the same cleanup there for consistency. 🐛 Potential IssuesNone identified - the code appears functionally correct. 🔒 Security ConsiderationsNo concerns - this is client-side routing logic with no security implications. ⚡ Performance ConsiderationsThe
📝 SummaryRecommendation: Approve with minor suggestions This is a solid PR that improves consistency between cloud and engine routes. The code is functional and well-structured. The suggestions above are minor improvements for code organization and clarity, not blockers. Action Items (Optional):
Great work! 🚀 |
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |

No description provided.