Fixed issues with DNA file uploads#48
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.
Parser (
lib/genotype-parser.ts)Rewrote the genotype file parser to fix a 57% upload failure rate identified via GA4 analytics. The failures broke down into two root causes: format detection routing files to the wrong parser, and individual parsers rejecting valid rows from edge-case provider exports.
Format coverage added or fixed:
"rs1"",""1"",...) now handled by stripping all"characters from field values#comment line and usesnameinstead ofrsid; both are now recognizedrsid chr pos allele1 allele2) now combined into a 2-char genotypeMTRSID CHROMOSOME POSITION GENOTYPEheaders with tab/comma delimiters now routed to the Monadic parser; purely space-separated headers fall through to the 23andMe whitespace parser to avoid a delimiter mismatchsplit('\n')replaced withsplit(/\r?\n/)across all parsersDetection logic hardened: AncestryDNA detection now skips
#lines (avoids false-matching 23andMe comment headers); detection scans 50 lines instead of 20 to handle files with long metadata preambles.Upload UX (
app/components/UserDataUpload.tsx,app/globals.css)console.errornow emits structured diagnostics on parse and upload failuresAnalytics (
lib/analytics.ts)genotype_file_loadednow includesdetected_format(23andme / ancestrydna / monadic) andfile_extensiongenotype_file_upload_failednow includesfile_extensionlastIndexOf('.')so extensionless filenames do not leak as the extension value in analytics events