Skip to content

feat(cloud): archiving#4126

Closed
jog1t wants to merge 1 commit into02-04-fix_traces_separate_entrypointsfrom
02-05-feat_cloud_archiving
Closed

feat(cloud): archiving#4126
jog1t wants to merge 1 commit into02-04-fix_traces_separate_entrypointsfrom
02-05-feat_cloud_archiving

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Feb 5, 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-4126 February 5, 2026 20:27 Destroyed
@railway-app
Copy link

railway-app bot commented Feb 5, 2026

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

Service Status Web Updated (UTC)
website ❌ Build Failed (View Logs) Web Feb 5, 2026 at 10:06 pm
frontend-cloud ❌ Build Failed (View Logs) Web Feb 5, 2026 at 10:05 pm
frontend-inspector ❌ Build Failed (View Logs) Web Feb 5, 2026 at 10:05 pm
mcp-hub ✅ Success (View Logs) Web Feb 5, 2026 at 8:28 pm

Copy link
Contributor Author

jog1t commented Feb 5, 2026

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.
Learn more


How to use the Graphite Merge Queue

Add 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.

@claude
Copy link

claude bot commented Feb 5, 2026

PR Review: feat(cloud): archiving

Overview

This PR adds project and namespace archival/deletion functionality to the frontend. The implementation includes confirmation dialogs, settings pages, and necessary data provider mutations.

Code Quality & Best Practices

✅ Strengths

  1. Good confirmation UX: Requires typing the display name to confirm deletion, preventing accidental deletions
  2. Consistent patterns: Both project and namespace deletion follow the same structure
  3. Analytics tracking: PostHog events are properly captured for deletion actions
  4. Query invalidation: Properly invalidates queries after deletion to keep UI in sync
  5. Navigation handling: Correctly navigates users away after deletion
  6. Type safety: Using TypeScript interfaces for props and proper type imports

⚠️ Issues & Concerns

1. Inconsistent async handling in namespace deletion (frontend/src/app/dialogs/confirm-delete-namespace-frame.tsx:31)

queryClient.invalidateQueries();  // Not awaited
onClose?.();

The project deletion dialog awaits this call (line 31 in confirm-delete-project-frame.tsx), but the namespace deletion doesn't. This should be consistent:

await queryClient.invalidateQueries();

2. Missing error handling
Neither deletion dialog handles errors. If the API call fails, users won't see an error message. Consider adding error handling:

const { mutate, isPending, error } = useMutation({
  ...dataProvider.archiveCurrentNamespaceMutationOptions(),
  onSuccess: async () => { /* ... */ },
  onError: (error) => {
    // Show error toast/notification
  },
});

3. Styling inconsistency (frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/settings.tsx:62)

<div className="pb-4 pb-8 px-6 max-w-5xl mx-auto my-8 @6xl:border @6xl:rounded-lg">

Duplicate pb-4 pb-8 classes - the second one (pb-8) will override the first. Should be just pb-8.

4. Same styling issue in namespace settings (frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace/settings.tsx:811)
Same duplicate padding issue as above.

5. Minor: Extra space in className (settings.tsx:74)

<p className=" mb-4">

Leading space in className is unnecessary.

6. Type safety concern
The displayName prop isn't validated to exist before being passed. If displayName is undefined, the confirmation will fail silently. Consider adding validation or making it non-optional with proper error handling.

7. Refactoring in actor-builds-list.tsx
The refactor from useMemo to a standalone function is good, but:

  • The extracted getActorIcon function is now called on every render instead of being memoized
  • Consider keeping useMemo or wrapping the component in React.memo() if performance becomes an issue
  • The change is functionally correct but may have minor performance implications

8. Data provider mutations don't specify onError callbacks
The mutation options in cloud-data-provider.tsx (lines 282-311, 329-341, 350-361) don't include error handling. While this might be intentional, it means errors will bubble up without structured handling.

9. Quote consistency in const.ts (line 141)

{ name: 'queues', displayName: 'Queues' },

Uses single quotes while surrounding lines use double quotes. Should be:

{ name: "queues", displayName: "Queues" },

Performance Considerations

  1. Query invalidation is broad - queryClient.invalidateQueries() without filters invalidates ALL queries. This could cause unnecessary refetching. Consider being more specific:
await queryClient.invalidateQueries({ queryKey: ['projects'] });
  1. Navigation race condition - The navigation happens in the onSuccess callback after query invalidation. If invalidation is slow, the user might see stale data on the new page briefly.

Security Concerns

✅ Good security practices:

  1. Confirmation required before destructive actions
  2. User must type exact display name to confirm
  3. Analytics tracking for audit trail

⚠️ Considerations:

  1. No mention of server-side validation - ensure the backend also validates permissions
  2. The PostHog events capture displayName which might contain sensitive info - verify this is acceptable

Test Coverage

Missing:

  • No tests included for the new dialog components
  • No tests for the mutation options in data provider
  • No integration tests for the deletion flow

Recommendations:

  • Add unit tests for confirmation dialogs
  • Add integration tests that verify the full deletion flow
  • Test error scenarios (API failures, network issues, etc.)

Additional Observations

  1. Unrelated changes: The PR includes several unrelated changes:

    • Example registry updates (queue-sandbox, workflow-sandbox)
    • README updates
    • Package lock changes
    • Deletion of AGENTS.md file

    These should ideally be in separate commits or PRs for clearer history.

  2. Missing PR description: The PR template checkboxes are all unchecked, suggesting the author didn't fill out the description properly.

  3. API type improvements: The changes to use Rivet.MetricName instead of the longer Rivet.namespaces.MetricsGetRequestNameItem are good refactoring.

  4. Binary file: A new image file was added (website/public/examples/queue-sandbox/image.png) - ensure this is optimized for web use.

Recommendations Summary

High Priority:

  1. Add error handling to deletion mutations
  2. Fix the async/await inconsistency in namespace deletion
  3. Remove duplicate CSS classes
  4. Add proper test coverage

Medium Priority:
5. Make query invalidation more specific
6. Add validation for displayName prop
7. Consider performance implications of removing useMemo

Low Priority:
8. Fix quote consistency
9. Remove extra space in className
10. Fill out PR description properly
11. Consider splitting unrelated changes into separate commits

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4126

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@4126

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4126

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4126

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4126

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4126

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4126

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4126

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4126

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4126

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4126

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4126

commit: c4d8fa7

@jog1t jog1t force-pushed the 02-05-feat_cloud_archiving branch from f47d2d1 to 54f39f1 Compare February 5, 2026 20:30
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4126 February 5, 2026 20:30 Destroyed
@jog1t jog1t changed the base branch from main to graphite-base/4126 February 5, 2026 20:33
@jog1t jog1t force-pushed the 02-05-feat_cloud_archiving branch from 54f39f1 to 4cfeb36 Compare February 5, 2026 20:34
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4126 February 5, 2026 20:34 Destroyed
@jog1t jog1t changed the base branch from graphite-base/4126 to 02-04-fix_traces_separate_entrypoints February 5, 2026 20:34
@jog1t jog1t force-pushed the 02-05-feat_cloud_archiving branch from 4cfeb36 to a993219 Compare February 5, 2026 21:48
@jog1t jog1t force-pushed the 02-04-fix_traces_separate_entrypoints branch from 0ad0c4d to df3efc4 Compare February 5, 2026 21:48
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4126 February 5, 2026 21:48 Destroyed
@jog1t jog1t marked this pull request as ready for review February 5, 2026 21:50
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 5, 2026

Graphite Automations

"Test" took an action on this PR • (02/05/26)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

@jog1t jog1t force-pushed the 02-05-feat_cloud_archiving branch from a993219 to c4d8fa7 Compare February 5, 2026 22:03
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4126 February 5, 2026 22:03 Destroyed
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 5, 2026

Merge activity

  • Feb 5, 10:06 PM UTC: jog1t added this pull request to the Graphite merge queue.
  • Feb 5, 10:06 PM UTC: CI is running for this pull request on a draft pull request (#4129) due to your merge queue CI optimization settings.
  • Feb 5, 10:07 PM UTC: Merged by the Graphite merge queue via draft PR: #4129.

graphite-app bot pushed a commit that referenced this pull request Feb 5, 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
@graphite-app graphite-app bot closed this Feb 5, 2026
@graphite-app graphite-app bot deleted the 02-05-feat_cloud_archiving branch February 5, 2026 22:07
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