Skip to content

Fix missing Mapbox preview and route URL on duplicate GPX upload#30

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gpx-upload-issue
Draft

Fix missing Mapbox preview and route URL on duplicate GPX upload#30
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gpx-upload-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

Duplicate GPX uploads via "Use Existing File" never rendered the map preview or route URL because fetchExistingFileContent omitted displayPoints from the onFileParsed callback in the two primary code paths.

  • Added displayPoints to DuplicateFile interface and read it from the Firestore document in checkForDuplicate
  • Pass displayPoints through onFileParsed in Method 1 (Firestore content cache) and Method 2 (Storage reference fetch), with a processGPXUpload() fallback for Method 2 if cached points are missing

The fresh upload path already passed all required args correctly — only the duplicate resolution paths were affected:

// Before (Methods 1 & 2): missing 5th arg → uploadedRoutePoints stays empty → no map
onFileParsed(content, filename, fileUrl, duplicateFound.docId || null);

// After: displayPoints flows through → map renders
onFileParsed(content, filename, fileUrl, duplicateFound.docId || null, duplicateFound.displayPoints);
Original prompt

This section details on the original issue you should resolve

<issue_title>gpx upload on duplicate, no mapbox review, no route url.</issue_title>
<issue_description>probably a condition that's not rendering, but normal path working as expected. backlog for now.</issue_description>

<agent_instructions>fix it.
</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@aleexwong gpx upload file selector still present, but that is expected after code refactored/ mods to just to the happy path.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 3, 2026

Deploy Preview for trainpace ready!

Name Link
🔨 Latest commit ba162e8
🔍 Latest deploy log https://app.netlify.com/projects/trainpace/deploys/69a6969ef6efee00087fa273
😎 Deploy Preview https://deploy-preview-30--trainpace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 82
Accessibility: 89
Best Practices: 100
SEO: 100
PWA: 60
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
trainpace Ready Ready Preview, Comment Mar 3, 2026 8:07am

…oute URL

When a duplicate GPX file is detected and the user clicks "Use Existing File",
the fetchExistingFileContent function now passes displayPoints to onFileParsed
for Methods 1 (Firestore cache) and 2 (Storage reference). This ensures the
Mapbox route preview renders and the route URL is properly generated.

Changes:
- Added displayPoints to DuplicateFile interface
- Read displayPoints from Firestore document in checkForDuplicate
- Pass displayPoints in Method 1 (Firestore cache)
- Pass displayPoints in Method 2 (Storage ref) with processGPXUpload fallback

Co-authored-by: aleexwong <65264501+aleexwong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix gpx upload issue with mapbox review Fix missing Mapbox preview and route URL on duplicate GPX upload Mar 3, 2026
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.

gpx upload on duplicate, no mapbox review, no route url.

2 participants