Repository navigation
fix(ui): accept the header_mapping log step, so imports no longer show as Failed - #223
Draft
amar-python wants to merge 1 commit into
Draft
amar-python wants to merge 1 commit into
amar-python wants to merge 1 commit into
Conversation
…w as Failed #186 made the API return a header_mapping step in an upload's logs. The React app's response schema did not list it, and the React app sends a header mapping with every dynamic upload. zod rejected the whole response ("Unexpected response shape ... logs.3.step"), so an import that had succeeded on the server was shown as Failed. Add the step, export the schema, and test that it accepts every step the API's loaders can pass to _log(), so the next new step fails a test, not the upload screen. Found by the browser end-to-end tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every dynamic-mode import through the React app currently shows as Failed even though the server saved it.
What happens on
mainThe React app sends a header mapping with every dynamic upload. Since #202 (#186), the API then adds a
header_mappingentry to the upload's logs. The app's response schema (processingLogSchema) did not list that step, so zod rejected the whole response:The import itself had succeeded: the file appeared under "Migrated files" while the upload report said "Failed". Reproduced with the real API and the Vite dev server in Chromium. With the API alone: upload with
headerMappingreturns stepsreceive, hash, parse, header_mapping, …; index 3 is thelogs.3in the error.Fix
header_mappingto the schema's step list.log-step-contract.test.ts: it reads every_log(logs, "<step>", …)inapi/servicesandapi/routersand checks the schema accepts each, so the next new step fails a test and not the upload screen. Both new assertions fail onmain(expected ['header_mapping'] to equal []) and pass here.Tests
tsccleanWhy #186's own tests missed it: they check the API and the database column, and the frontend tests mock the upload response, so nothing ran the real response through the real schema.
Generated by Claude Code