Skip to content

feat(exports): enable user data exports for all users - #5180

Merged
pandemicsyn merged 4 commits into
mainfrom
feat/enable-user-data-exports
Aug 18, 2026
Merged

feat(exports): enable user data exports for all users#5180
pandemicsyn merged 4 commits into
mainfrom
feat/enable-user-data-exports

Conversation

@pandemicsyn

@pandemicsyn pandemicsyn commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the temporary Kilo admin gate from user data export tRPC procedures
  • allow all authenticated users to open the data exports page
  • show the Data exports account-menu entry to every user
  • retain web-session-only access and per-user export ownership checks
  • allow asking for one data export every hour

@kilo-code-bot

kilo-code-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • apps/web/src/app/(app)/components/SidebarUserFooter.tsx
  • apps/web/src/app/(app)/data-exports/page.test.ts
  • apps/web/src/app/(app)/data-exports/page.tsx
  • apps/web/src/routers/user-exports-router.test.ts
  • apps/web/src/routers/user-exports-router.ts
Previous Review Summaries (2 snapshots, latest commit 5bc27de)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 5bc27de)

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (5 files)
  • apps/web/src/app/(app)/components/SidebarUserFooter.tsx
  • apps/web/src/app/(app)/data-exports/page.test.tsx
  • apps/web/src/app/(app)/data-exports/page.tsx
  • apps/web/src/routers/user-exports-router.test.ts
  • apps/web/src/routers/user-exports-router.ts

Incremental review of commit 5bc27de4 (throttle fix): the previous warning is resolved — the re-request throttle is now interval '1 hour' with a matching user-facing message ("You can request one data export every hour"), and the temporary pre-launch comment is removed. The new test correctly asserts rejection within the one-hour window, and the updated past-window test (61 minutes) is consistent with the new throttle. No UI copy references a specific throttle duration, so no mismatches remain. No new issues found in the changed code; no memory-leak concerns introduced (no new timers, subscriptions, or listeners).

Previous review (commit 3c765db)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/routers/user-exports-router.ts 90-91 Temporary 5-minute re-request throttle not restored to 24 hours. The code comment says "restore to 24 hours before going live" and this PR is the go-live (removes the admin gate for all users). The TOO_MANY_REQUESTS message (line 98) also tells users "one data export every 24 hours" while the actual throttle is 5 minutes — a user-facing mismatch, and the lowered throttle lets every user enqueue a full export every 5 minutes. (Reported summary-only: these lines are outside the PR diff hunks.)
Files Reviewed (5 files)
  • apps/web/src/app/(app)/components/SidebarUserFooter.tsx
  • apps/web/src/app/(app)/data-exports/page.test.tsx
  • apps/web/src/app/(app)/data-exports/page.tsx
  • apps/web/src/routers/user-exports-router.test.ts
  • apps/web/src/routers/user-exports-router.ts - 1 issue

The admin-gate removal itself is sound: baseProcedure still requires an authenticated user (context throws UNAUTHORIZED), requireWebSession blocks API-token access on all three procedures, and every query filters by kilo_user_id = ctx.user.id, preserving per-user export ownership. Test updates correctly extend coverage to non-admin users, including cross-user download denial. No memory-leak concerns introduced (no new timers, subscriptions, or listeners).

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 258.6K · Output: 18.3K · Cached: 780.5K

Review guidance: REVIEW.md from base branch main

@pandemicsyn
pandemicsyn marked this pull request as draft August 10, 2026 15:37
…-exports

# Conflicts:
#	apps/web/src/app/(app)/components/SidebarUserFooter.tsx
#	apps/web/src/app/(app)/data-exports/page.test.tsx
#	apps/web/src/routers/user-exports-router.test.ts
#	apps/web/src/routers/user-exports-router.ts
@pandemicsyn
pandemicsyn marked this pull request as ready for review August 18, 2026 15:14

@jrf0110 jrf0110 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably double check all of the authorization code here and make sure there aren't ways to request downloads that don't actually belong to you

@pandemicsyn
pandemicsyn merged commit 027de26 into main Aug 18, 2026
18 checks passed
@pandemicsyn
pandemicsyn deleted the feat/enable-user-data-exports branch August 18, 2026 15:55
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.

2 participants