Skip to content

fix(ingest): list per-event EPCIS batch errors and clear stale results before API-key save - #3661

Closed
PetrefiedThunder wants to merge 1 commit into
mainfrom
fix/ingest-3578-clean
Closed

PetrefiedThunder wants to merge 1 commit into
mainfrom
fix/ingest-3578-clean

Conversation

@PetrefiedThunder

@PetrefiedThunder PetrefiedThunder commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #3578.

#3578 can't pass Commit Message Check because it inherited a non-conventional commit (120f8b353c, "Remove made-up sample files from frontend/public/samples") from another branch, and fixing that would need a history rewrite. This PR carries the same net changes from #3578 (head 89ea2b5088b46860412f5b3d48365d42437e01d9) as one conventional commit on a clean branch off main. They were applied with git diff origin/main...89ea2b50 -- <paths> | git apply, with no hand edits, and each file matches #3578's head byte for byte.

The original work is by DeepSeek in #3578:

  • List per-event errors for rejected EPCIS batches, in both atomic and partial shapes (epcisErrorEventMessages in frontend/src/lib/epcis-upload.ts).
  • Clear earlier results and errors before the API-key save, so a failed save doesn't leave stale error lines on screen.
  • Add a URL-tab error state for a failed API-key save.
  • Tests: ingest-epcis-batch-errors.test.tsx (new), plus updates to ingest-csv.test.tsx and ingest-epcis.test.tsx.

Files: frontend/src/app/ingest/page.tsx, frontend/src/lib/epcis-upload.ts, and three tests under frontend/src/__tests__/pages/.


Note

Low Risk
Ingest UI and error-display logic only; no API or auth behavior changes beyond clearer messaging and submit ordering.

Overview
Rejected EPCIS batch uploads now show a summary line plus one Event N: line per failed event, for both atomic (detail.errors) and partial (top-level errors) 400 responses. Single-event failures still show one combined message with no per-event prefix.

epcisErrorEventMessages in epcis-upload.ts parses those backend shapes; the ingest page stores them in epcisErrorEvents and renders them under the Ingestion Failed callout.

Submit flow: prepareSubmit clears prior CSV/EPCIS/URL results and mutation state before saving a changed API key, so a failed cookie write does not leave old batch error text on screen. URL-tab API-key failures use dedicated urlError state (with Ingestion Failed) instead of job status error.

Tests cover URL-tab API-key errors, atomic/partial batch listing, single-event behavior, and clearing stale EPCIS lines on API-key save failure.

Reviewed by Cursor Bugbot for commit 3e200d0. Bugbot is set up for automated code reviews on this repo. Configure here.

…efore API-key save, show URL-tab errors

Supersedes #3578 with the same net changes on a clean branch off main. Original work by DeepSeek.
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
regengine Ready Ready Preview Oct 27, 2026 4:18am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T04:17:48.047858Z 3e200d0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The ingestion page now shows event-level messages for EPCIS submission failures. It clears prior results and errors before API-key saves, routes save failures to the active tab, and resets the separate URL and EPCIS error state. New and updated tests cover URL save failures and EPCIS batch and single-event error displays.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Blocker Checklist

Head SHA: 3e200d08e131b55259023db23957f2192aca0799

Status: Blocked (1 open blocker)

Review Threads (1 unresolved)

Changes Requested (0)

  • No reviews requesting changes

Blocked Engines (0)

  • No blocked review engines

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Vercel preview access note removed (A-2177 secret-hygiene cleanup).
Access is via Vercel login (Deployment Protection).

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3e200d0. Configure here.

notifyDashboardRefresh();
} catch (error) {
setEpcisError(epcisErrorMessage(error));
setEpcisErrorEvents(epcisErrorEventMessages(error));

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.

URL error omits workspace error class

Low Severity

A failed API-key save on the URL tab now sets urlError instead of statusError, but PageContainer still keys workspace-load-error off statusError. File and EPCIS API-key failures still apply that class via csvError and epcisError, so the URL tab no longer hides the shell success badge on the same failure.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3e200d0. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Bundle Size Report

Metric Size
Total JS 5566.5KB (5.43MB)
Total CSS 132.0KB
Limit 10.0MB

Bundle is within the 10.0MB limit.

@PetrefiedThunder

Copy link
Copy Markdown
Collaborator Author

This closed when I renamed the branch. It continues in #3665 at the same head, 3e200d0.

This branch was successfully deployed

1 active deployment
Preview — 3e200d08 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant