Repository navigation
fix(ingest): replace DEMO-DOC-ID fallback with empty state - #3653
Conversation
Signed-off-by: Christopher Sellers <1@christophersellers.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
✅ Bundle Size Report
Bundle is within the 10.0MB limit. |
PR Blocker ChecklistHead SHA: Status: Ready
|
|
Vercel preview: https://regengine-kb90xunm0-petrefiedthunders-projects.vercel.app Access is via Vercel login (Deployment Protection). |
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS gemini 5144d59
Code Review: RegEngine #3653
1. Correctness
- Derived State:
completedDocumentIdcleanly derivesingestMutation.data?.document_idduring render without unnecessary effects or state synchronization. - Defensive Guard: The check
typeof completedDocumentId === 'string' && completedDocumentId.length > 0properly handlesundefined,null, and empty string inputs, ensuring<NormalizedDocumentViewer />is only mounted when a valid identifier exists. - Empty State: Renders an accessible, appropriately styled fallback message (
text-small text-re-text-tertiary) when no document ID is present.
2. Security & Tenant Isolation
- Elimination of Mock Fallback: Removes the hardcoded fallback
'DEMO-DOC-ID', which previously risked leaking demo state, triggering cross-tenant lookup anomalies, or polluting audit evidence. - Safe Handling: Sourced exclusively from authenticated mutation response data with no client-side injection vectors.
3. Tests
- Coverage: Adds comprehensive unit tests covering:
- Missing/absent
document_id(verifies fallback message and absence of viewer). - Empty string
document_id(verifies fallback message and absence of viewer). - Valid
document_id(verifies viewer renders with exact document ID).
- Missing/absent
- Tooling & Secret Scanning: Uses
vi.hoistedfor Vitest mock hoisting and includes// pragma: allowlist secretfor the auth mock to satisfy CI secret scanners (detect-secrets).
VERDICT: PASS
|
REVIEW: PASS hermes ff2daa4 Merge ff2daa4 (PR + origin/main 4823440) keeps both sides of ingest/page.tsx: Muse empty state ( Local (SSD, load~7): vitest ingest-csv + ingest-normalized-viewer 19/19; tsc --noEmit exit 0; eslint touched files 0 errors (1 preexisting react-hooks/set-state-in-effect warning at page.tsx:221 from merged main). CI at post: CodeQL Analyze + Semgrep still queued/pending; Bugbot/Vercel pass; PR Blocker fail (expected pre-PASS). No push/merge. |
Follow-up flagged by Codex in its review of #3622 (non-blocking finding: the
DEMO-DOC-IDfallback infrontend/src/app/ingest/page.tsx).Change
NormalizedDocumentVieweronly when the ingest response has a non-emptydocument_id. Otherwise it shows a muted empty state ("No normalized document is available for this ingest."). The page no longer makes up a placeholder id.src/__tests__/pages/ingest-normalized-viewer.test.tsxcovers three cases:document_idabsent,document_idempty, and a real id passed through. Ids are generated at runtime withcrypto.randomUUID().Verification
Based on origin/main. #3622 is still open, and a test merge of the two branches shows no conflict.
Note
Low Risk
UI-only ingest completion behavior with no auth or API contract changes; reduces risk of misleading document previews.
Overview
After URL ingest completes, the completed panel no longer fabricates a document id from
doc_id,job_id, or theDEMO-DOC-IDplaceholder.NormalizedDocumentViewerrenders only when the ingest response includes a non-emptydocument_id; otherwise users see a muted message: No normalized document is available for this ingest.Tests were updated to match: an existing CSV/URL scenario that completes without
document_idnow asserts the empty state instead of a fake viewer receipt, and a newingest-normalized-viewersuite covers absent, empty, and validdocument_idcases.Reviewed by Cursor Bugbot for commit ff2daa4. Bugbot is set up for automated code reviews on this repo. Configure here.