Repository navigation
fix(uploads): validate parsed files before persisting artifacts - #39
Merged
Merged
Conversation
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.
A rejected upload could still persist its raw FILE before parsing failed. A malformed XLSX therefore left a hidden artifact/version, consumed the session quota, and could enter later model context. With a one-file quota, even the next valid CSV was rejected.
Finish parsing, sanitization, warnings and column validation before creating upload artifacts. Keep quota-check ordering, successful FILE/TABLE/PROCESS lineage and returned fields unchanged. Preserve accepted raw-only legacy XLS uploads. This change addresses input parsing failures; it does not introduce rollback for database write failures.
Validation: five invalid-input regressions failed before the fix and now prove no artifacts/versions remain; a valid CSV succeeds afterward under a one-file quota. Legacy XLS bytes and raw-only artifact versions are verified. Full npm test: 579 tests, 567 passed, 12 optional skips, 0 failures. Lint 0 errors / 7 existing warnings; eval 14/14 fixtures with 2 L3 judgments pending. Independent review approved and reran the local-file suite: 22/22 passed.
Depends on #37 for the shared PostgreSQL HTTP acceptance path; merge #37 first. Its prerequisite changes are included so this branch can run the full CI suite.