Skip to content

fix(ui): accept the log steps M5 added, so dynamic imports stop showing as Failed - #231

Merged
amar-python merged 1 commit into
mainfrom
claude/fix-m5-log-steps
Nov 10, 2026
Merged

amar-python merged 1 commit into
mainfrom
claude/fix-m5-log-steps

Conversation

@amar-python

Copy link
Copy Markdown
Owner

Every dynamic-mode import through the React app shows as Failed again on main, though the server saved it. Same bug as #223, new cause.

What happens

M5 (#109) makes a dynamic upload log three new steps: version, schema_check and cross_upload_duplicates. The React app's response schema (processingLogSchema) doesn't list them, so zod rejects the whole response:

Unexpected response shape from /api/csv/upload: logs.5.step: Invalid option: expected one of "receive"|"hash"|…

Reproduced in Chromium on the production build: the upload report says "Failed" while the file appears under "Migrated files".

Fix

Add the three steps to the schema's list (3 lines).

How it was caught

log-step-contract.test.ts (added in #223) reads every step the API's loaders can log and checks the schema accepts each one. On main it fails with exactly these three: expected ['version', 'schema_check', …(1)] to deeply equal []. With this change it passes.

The frontend tests are not run in CI, which is how main stayed red unnoticed after M5 merged. Running npx vitest run in the quality gate would stop this class of bug; I haven't added that here.

Tests


Generated by Claude Code

…ng as Failed

M5 (#109) logs three new steps on a dynamic upload: version, schema_check
and cross_upload_duplicates. The React app's response schema did not list
them, so zod rejected the whole response ("Unexpected response shape ...
logs.5.step") and an import that had succeeded was reported as Failed.
Same failure as the header_mapping step (#223), same fix.

log-step-contract.test.ts, added in #223, caught it: it fails on main with
the three missing steps. The frontend tests do not run in CI, which is how
main sat red.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
@amar-python
amar-python marked this pull request as ready for review November 10, 2026 06:32
@amar-python
amar-python merged commit 066e41d into main Nov 10, 2026
4 checks passed
@amar-python
amar-python deleted the claude/fix-m5-log-steps branch November 10, 2026 06:33
amar-python pushed a commit that referenced this pull request Nov 10, 2026
#231 and #232 both added the three M5 log steps, so main lists version,
schema_check and cross_upload_duplicates twice. zod collapses duplicate
enum values, so it is harmless at runtime, but the duplicates were an
accident. Remove them and add a test that reads the source (the parsed
schema can't show them); it fails with a duplicate present.

docs/ISSUE_TESTS.md: #174 is done on main (#204).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
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