Skip to content

[AISAGE-733] feat(admin): accept user email in API request log download - #7645

Merged
chrarnoldus merged 2 commits into
mainfrom
kilo/modular-nebula-8qg
Oct 16, 2026
Merged

chrarnoldus merged 2 commits into
mainfrom
kilo/modular-nebula-8qg

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • The admin API request log download now accepts either a user ID or an email in the user field.
  • The route looks up kilocode_users by id or google_user_email and filters logs by the resolved user ID. An exact ID match takes precedence.
  • If no user row matches and the value is not an email, the value is still used as a raw user ID. This keeps downloads working for logs whose user row no longer exists.
  • If no user has the given email, the route returns a 404 that says no user has that email, not a generic "no records" error.
  • The field label and placeholder now read "User ID or email".

Verification

  • jest src/app/admin/api/api-request-log/download/route.test.ts: 33 passed, including new tests for an email lookup and an unknown email.
  • tsgo --noEmit in apps/web: no errors.
  • oxlint and oxfmt on changed files: clean.

@chrarnoldus chrarnoldus self-assigned this Oct 15, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change resolves the earlier case-sensitive email lookup by adding an exact-match-first then case-insensitive fallback with ambiguity handling; no new defects found in the changed lines.

Files Reviewed (3 files)
  • apps/web/src/app/admin/api/api-request-log/download/route.ts
  • apps/web/src/app/admin/api/api-request-log/download/route.test.ts
  • apps/web/src/app/admin/api-request-log/page.tsx
Previous Review Summary (commit 478378c)

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

Previous review (commit 478378c)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The email-based user lookup matches google_user_email case-sensitively, so a differently-cased email returns a misleading 404 for an existing user.

Overview

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

SUGGESTION

File Line Issue
apps/web/src/app/admin/api/api-request-log/download/route.ts 140 Email lookup is case-sensitive; consider the existing findUserByEmailCaseInsensitive / findUserByNormalizedEmail helpers
Files Reviewed (3 files)
  • apps/web/src/app/admin/api/api-request-log/page.tsx - no issues
  • apps/web/src/app/admin/api/api-request-log/download/route.ts - 1 issue
  • apps/web/src/app/admin/api/api-request-log/download/route.test.ts - no issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 40.4K · Output: 5.1K · Cached: 255.2K

Review guidance: REVIEW.md from base branch main

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