Complete client review and remove related data when deleting Projects#122

merged23
design-system/linear-quartz
feature/portal-approval-stage-assets
openedOct 22, 2026bySScreen
View on GitHubTwo-way sync enabledPR last imported Oct 24, 2026

Summary

Closes #103. Closes #115. Closes #93. Closes #107. Closes #104.

Middle of the stack: #109 → this PR → #123. GitHub only honours the closing links once this PR targets main, which happens automatically when #109 merges and its branch is deleted (or by changing the base by hand). Also addresses source fixes from #94 and #98, which remain open for publication and operational verification.

Clients can approve the current Media Version, review version history, annotate frames, and see public stage assets. Approval locks comments on that version, moves the Project to its approved stage, and notifies eligible editors. Editors can see who viewed the portal and manage stage assets.

Deleting a Project now closes its portals immediately and queues durable cleanup of related records and hosted files. The previous mutation deleted only the Project row.

text
1Project deletion
2 authorize → close portals → delete Project → durable cleanup job
3 native/R2 files → Media Versions and feedback → portal records
4 upload reservations → Activity, resources and Project AI results
5 retry interrupted work → retain completed tombstone
6
7Shared Client and payment history stay available.
8External hosting accounts and their files remain outside Relay's cleanup.

Native uploads now bind bytes to their reservation through the HTTP upload handler. Cleanup uses the original charged Workspace, removes released uncommitted bytes, deletes linked brief-import results, and rejects resource snapshots for deleted Projects. Legacy bytes without reliable billing ownership are recorded for operator reconciliation.

The policy and marketing copy describe background cleanup and its limits, list optional Gemini/OpenAI processing, and share the existing support address. The stale roadmap-token instructions are removed. See docs/operations/project-deletion.md for recovery and rollout instructions.

Evidence

  • Before these changes: 302 Convex tests and 315 unit tests. After: 313 Convex tests and 320 unit tests pass.
  • App and marketing TypeScript checks, production builds and Cloudflare builds pass locally. Design check, MUI allowlist, CSP checks, marketing-origin checks, formatting and whitespace checks pass.
  • Nine deletion tests cover authorization, bounded cleanup, interrupted recovery, R2 retry/late-upload handling, native upload binding, released blobs, original Workspace accounting, legacy unattributed bytes, brief results and stale resource snapshots. Shared records and another Project's data are preserved.
  • An independent second review cleared all five deletion findings after fixes. The earlier portal review's eight findings are also fixed. No production deletion or signed-in browser journey was run.
  • Convex production dry-run passed against spotted-pheasant-146 with additive schema/index changes. Standalone TypeScript checks passed; the CLI's separate typecheck was disabled because its local compiler lookup fails in this workspace.

Pending release evidence: phone approval (#103), phone-to-desktop annotations (#104), stage visibility (#107), and the PDF launch decision/live R2 verification (#93). These remain in the local launch tracker and #95. Policy-owner review, production retention and mail verification remain in #94, #96 and #97.

Merge Danger

Door: one-way for user-confirmed Project deletion. The deployment adds schema fields, indexes and functions; it does not purge historical orphaned data. Once a deletion job removes hosted bytes and related records, reverting code cannot restore them.

Blast Radius: Workspace Project data, public portals, comments, upload accounting, notifications and launch copy. Shared Clients and payment history are preserved. Free plans still cannot upload hosted files. Native HTTP uploads are limited to 20 MB; R2 stage assets are not exposed in the portal.

Production: already deployed from 5f1acdb on 2026-10-23: Convex spotted-pheasant-146 first (additive indexes only), then the relay Worker (version 7a88fe47), which serves the CSP allowing *.convex.site. Merging does not need another backend deploy. Remote Cloudflare build checks still need a look in the Cloudflare dashboard; local builds pass.

Checks

2 failing · 2 successful
Some checks were not successful

Failing2

2868f9b

Added 17 commits

  • Fix client portal comment, approval, and view-recording defects0b866a2
  • Gate PDF brief import on R2 configuration0fbe3d5
  • Add stage-scoped assets to projects278f0fc
  • Merge #93: gate PDF brief import on R2 configuration29346d5
  • feat(portal): approve, lock and version switching in the UI4461323
  • Narrow the changelog leak check to the internal approvedBy key4ced8b5
  • Merge review fixes: bind stage uploads, bound portal comments, owner notification checks, deduped views6de6d7e
  • Merge #107 follow-up: client-visible stage assets in the portal73f1eb8
  • Allow stage asset uploads to the Convex HTTP endpoint in the CSP8146dc9
  • feat(portal): approve and lock shared media versions8ed21e8
  • Merge #107: stage-scoped project assets993842e
  • Merge #103/#115: portal approval, version history and viewer log UIc25bb02
  • Expose client-visible stage assets in project portalsc41ed56
  • feat(portal): stage files and draw-on-frame client feedbackc5f0d11
  • fix(convex): secure asset uploads and bound portal feedbackd3d91c7
  • Merge review fixes: per-version approval state, read-only approved comments, committed viewer names, annotations over the playerdb52c2a
  • Merge #104: draw-on-frame portal feedback and client-visible stage assetsfefb9dd
Synced from GitHub

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 057ad36c-f3e6-4fc0-b839-329c168a2da1
📥 Commits

Reviewing files that changed from the base of the PR and between 768c7ba61ca9d37ba1fe6bdbfa617dcb92779cff and 2868f9b3544b73a669bc91906d84dfd1ca83b76c.

⛔ Files ignored due to path filters: 1
  • apps/web/convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing: 65
  • .scratch/free-launch/issues/01-check-byok-policy.md
  • .scratch/free-launch/issues/02-check-marketing-release.md
  • .scratch/free-launch/map.md
  • .scratch/subscription-plans/issues/01-certify-free-launch.md
  • .scratch/subscription-plans/issues/03-add-provider-neutral-subscription-foundation.md
  • .scratch/subscription-plans/issues/04-launch-creator-with-razorpay.md
  • .scratch/subscription-plans/issues/05-certify-creator-client-experience.md
  • .scratch/subscription-plans/issues/06-certify-creator-paid-release.md
  • .scratch/subscription-plans/spec.md
  • apps/web/.env.production
  • apps/web/convex/briefImport.test.ts
  • apps/web/convex/briefImport.ts
  • apps/web/convex/briefImportPrompt.ts
  • apps/web/convex/briefImportUploads.ts
  • apps/web/convex/crons.ts
  • apps/web/convex/domainValidators.ts
  • apps/web/convex/http.ts
  • apps/web/convex/mediaVersionAnnotations.ts
  • apps/web/convex/mediaVersionComments.test.ts
  • apps/web/convex/mediaVersionComments.ts
  • apps/web/convex/projectDeletion.test.ts
  • apps/web/convex/projectDeletion.ts
  • apps/web/convex/projectFiles.test.ts
  • apps/web/convex/projectFiles.ts
  • apps/web/convex/projectPortals.test.ts
  • apps/web/convex/projectPortals.ts
  • apps/web/convex/projects.ts
  • apps/web/convex/r2.ts
  • apps/web/convex/r2Settings.ts
  • apps/web/convex/resourceLinks.ts
  • apps/web/convex/schema.ts
  • apps/web/convex/stageAssets.test.ts
  • apps/web/convex/stageAssets.ts
  • apps/web/convex/stageAssetsValidators.ts
  • apps/web/convex/statusDrafts.test.ts
  • apps/web/security-headers.mjs
  • apps/web/src/app/client-portal/client-portal-view.test.ts
  • apps/web/src/app/client-portal/client-portal-view.tsx
  • apps/web/src/app/privacy/privacy-page.tsx
  • apps/web/src/components/media-version-comments.tsx
  • apps/web/src/components/precision-projects.tsx
  • apps/web/src/components/project-portal-panel.tsx
  • apps/web/src/features/media-version-comments/annotation-overlay.tsx
  • apps/web/src/features/media-version-comments/media-version-annotations.test.ts
  • apps/web/src/features/media-version-comments/media-version-annotations.ts
  • apps/web/src/features/media-version-comments/media-version-comments-surface.test.tsx
  • apps/web/src/features/media-version-comments/media-version-comments.ts
  • apps/web/src/features/notifications/notification-bell.tsx
  • apps/web/src/features/projects/brief-import.test.tsx
  • apps/web/src/features/projects/brief-import.tsx
  • apps/web/src/features/projects/project-stage-asset-data.ts
  • apps/web/src/features/projects/project-stage-assets.tsx
  • apps/web/src/features/projects/project-table-domain.ts
  • apps/web/src/features/projects/project-view.ts
  • apps/web/src/features/projects/project-workspace.tsx
  • apps/web/src/features/projects/projects-application.tsx
  • apps/web/src/lib/support-contact.ts
  • apps/website/.env.example
  • apps/website/app/about/page.tsx
  • apps/website/app/privacy-and-data/page.tsx
  • apps/website/lib/links.ts
  • docs/operations/contact-email.md
  • docs/operations/project-deletion.md
  • docs/visibility.md
  • packages/shared/src/links.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Synced from GitHub

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
2868f9b 2026-10-23T00:10:24.466Z View logs ↗
  • Build: Failed ❌

View logs ↗
a9db7e5 2026-10-22T22:29:32.770Z View logs ↗
  • Build: Failed ❌

View logs ↗
0afa9c9 2026-10-22T21:15:21.078Z View logs ↗
  • Build: Failed ❌

View logs ↗
db52c2a 2026-10-22T15:32:11.104Z View logs ↗
Ccapy-aiBotreviewed · 3 inline threadsOct 22, 2026
Synced from GitHub

Capy found 3 potential issues (3 medium).

View 2 other findings in Capy.

Open in Capy

……@@ -0,0 +1,271 @@
160+ drawing.current = event.pointerId;
161+ const point = readPoint(event);
162+ if (tool === "pin") {
163+ onChange([...shapes, { type: "pin", x: point.x, y: point.y }]);
Ccapy-aiBoton line 163Oct 22, 2026

Drawing can exceed the server's annotation limits

Medium Severity

The editor allows a twenty-first pin, or four strokes totaling more than 600 points, because start() appends without a shape limit and move() checks only the per-stroke limit. Submitting that otherwise valid comment then fails in normalizeAnnotations, so users must discard drawings through Undo or Clear before they can send it. Enforce the server's shape and total-point budgets while drawing and explain when a limit is reached.

Open in Capy

Fixed in 75ee964. Drawing now stops at the server limits (20 shapes, 600 total points), with tests in media-version-annotations.test.ts.

apps/web/src/components/media-version-comments.tsxline 78Outdated · db52c2aOpen thread
……@@ -49,6 +50,47 @@ function commentDate(value: string) {
75+ );
76+ return (
77+ <div className="mt-3">
78+ {onSeek && seconds !== undefined ? (
Ccapy-aiBoton line 78Oct 22, 2026

Untimed annotations cannot be previewed over the player

Medium Severity

A client can draw marks and submit with the optional timestamp blank; neither drawing nor submission captures a playback time. CommentAnnotation renders those saved marks as a noninteractive thumbnail when timestampSeconds is absent, and onCommentSelect is invoked only through onSeek, so the marks can never be selected for the new player overlay. Separate annotation selection from seeking, or capture/require the frame timestamp when creating marks.

Open in Capy

Fixed in 75ee964. Untimed annotations, and annotations on external-link videos, can be selected and shown in the shared annotation frame. Regression test in media-version-comments-surface.test.tsx.

apps/web/convex/stageAssets.tsline 479Outdated · db52c2aOpen thread
……@@ -0,0 +1,493 @@
476+ const stage = project.workflowStages.find(
477+ (entry) => entry.id === asset.workflowStageId
478+ );
479+ await ctx.db.patch(args.assetId, {
Ccapy-aiBoton line 479Oct 22, 2026

Stage asset storage cannot be reclaimed

Medium Severity

When accumulated stage uploads exhaust workspace storage, removing every asset only archives its row and leaves all bytes charged to retainedStorageBytes. Unlike project files, stage assets have no permanent-delete mutation or UI, and projectFiles.removeFile cannot delete them. The workspace can therefore remain unable to upload after removing all its stage assets. Add an authorized permanent-delete path that deletes the stored object and releases its retained quota while preserving audit history.

Open in Capy

Fixed in 75ee964. Archived native stage uploads now have Delete permanently, which deletes the file, releases the original Workspace's retained quota once, and removes the row in one transaction. Covered in stageAssets.test.ts.

Synced from GitHub

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
2868f9b 2026-10-23T00:10:37.706Z View logs ↗
  • Build: Failed ❌

View logs ↗
a9db7e5 2026-10-22T22:29:50.625Z View logs ↗
  • Build: Failed ❌

View logs ↗
0afa9c9 2026-10-22T21:15:32.862Z View logs ↗
  • Build: In progress 🔵

View logs ↗
ea6a5fb 2026-10-22T21:12:01.437Z View logs ↗
  • Build: Failed ❌

View logs ↗
db52c2a 2026-10-22T15:32:43.279Z View logs ↗

Added 2 commits

  • Remove Project data through durable cleanup and align launch privacy copyea6a5fb
  • Separate completed launch fixes from pending production checks0afa9c9
Ccapy-aiBotreviewedOct 22, 2026
Synced from GitHub

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

Added 1 commit

  • Free storage for archived stage uploads and keep annotations within server limits75ee964

Added 2 commits

  • Set the production Convex site URL for app builds5f1acdb
  • Regenerate Convex API types for the new modulesa9db7e5

Added 1 commit

  • Merge design-system/linear-quartz into feature/portal-approval-stage-assets (LFS path fix)2868f9b