fix(admin): review follow-up — users.id string, ETL response schemas, retry guards#2410
Conversation
- Fix users.id schema: t.Number() → t.String() (users.id is text PK, not serial) - Update deleteUser/hardDeleteUser/restoreUser signatures: id: number → id: string - Add TypeBox response schemas to all 4 new ETL routes (failure-summary, job-failures, reset-stuck, retry) — Eden Treaty consumers were getting unknown payloads - Derive EtlFailureSummary/EtlJobFailures types via Static<> instead of hand-written interfaces - Parallelize independent DB queries in failure-summary and job-failures via Promise.all - Restrict retry to failed jobs only (was accepting completed, risking duplicate ingest) - Clean up orphaned running row on enqueue failure (mark new job failed in catch) - Validate jobId as UUID on failures and retry endpoints
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File CoverageNo changed files found. |
Coverage Report for API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
packrat-admin | 868aa4c | Commit Preview URL Branch Preview URL |
May 12 2026, 05:42 PM |
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up to the earlier admin/ETL work, aligning admin user ID typing with the actual DB schema, tightening ETL admin retry semantics, and ensuring the new ETL admin endpoints have explicit TypeBox response schemas so Eden Treaty clients get strongly typed payloads.
Changes:
- Fix admin user
idschema/type fromnumber→stringto matchusers.id(textPK) and update related admin client method signatures. - Add missing TypeBox
responseschemas for the ETL admin endpoints (failure summary, per-job failures, reset-stuck, retry). - Improve ETL admin endpoint behavior: parallelize independent DB queries, validate
jobIdas UUID, and prevent retrying non-failedjobs (plus mark the cloned job asfailedif enqueue fails).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/api/src/schemas/admin.ts | Updates AdminUserItemSchema.id to t.String() and introduces ETL admin response schemas (failure summary, job failures, reset-stuck, retry). |
| packages/api/src/routes/admin/analytics/catalog.ts | Wires new ETL response schemas into route response: definitions, adds UUID param validation, parallelizes queries, and strengthens retry/enqueue guards. |
| apps/admin/lib/api.ts | Switches user mutation helpers to accept string IDs and derives ETL response types from the shared schemas via Static<>. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Follow-up to #2409 — this commit missed the merge window.
users.idtype fix:AdminUserItemSchema.idwast.Number()butusers.idis atextPK — changed tot.String(). UpdatesdeleteUser/hardDeleteUser/restoreUsersignatures fromnumbertostring.response:schemas — Eden Treaty consumers were gettingunknownpayloads without them.EtlFailureSummary/EtlJobFailuresderived viaStatic<>(dropped hand-written duplicates).failure-summaryandjob-failuresendpoints now usePromise.all.failedjobs (was accepting completed, risking re-ingest). Enqueue failure marks orphaned running row as failed.jobIdparams infailuresandretryendpoints.Post-Deploy Monitoring & Validation
No additional operational monitoring required — type-only and query-guard changes with no new runtime paths.
🤖 Generated with Claude Code