Skip to content

fix(upload): stop the track form wiping description and tags on reinitialize - #14561

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/upload-form-wipes-description-and-tags
Aug 18, 2026
Merged

fix(upload): stop the track form wiping description and tags on reinitialize#14561
dylanjeffers merged 1 commit into
mainfrom
fix/upload-form-wipes-description-and-tags

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

Fixes the #eng report: a track published with its description, tags and collaborator all missing right after upload.

EditTrackForm runs Formik with enableReinitialize, so it resets the whole form whenever initialValues deep-changes. UploadTrackForm built those values by spreading track.metadata and then hard-overwriting description, tags, stems, isrc and iswc with blanks — plus a fresh new Date() on every recompute.

formState.tracks is rewritten with the user's edits on every submit, and EditPage.onContinue calls setFormState while still on the edit phase, before the upload confirmation modal resolves. So pressing "Complete Upload" recomputes initialValues → Formik resets → the typed description and tags are blanked. Publishing from that point uploads an empty description and no tags, while title/genre/mood/artwork survive because they come from the ...track.metadata spread — and an emptied genre then falls back to the adapter's DEFAULT_GENRE (Electronic).

Changes

  • Prefer values already on track.metadata over the initialMetadata seed, so a reinitialize no longer discards user input.
  • Preserve a user-disabled field_visibility.remixes instead of forcing it back to true.
  • Drop the releaseDate key — it was dead (the adapter reads release_date) and minting a new Date() on every call guaranteed a reset on every recompute.
  • Extract the mapping into an exported getTrackEditInitialMetadata so it's unit-testable.

What this does not cover

The "collaborator vanished" half of the report is a separate, arguably-intended behaviour: the API only returns pending_collaborators on the requester's own tracks, and GiantTrackTile selects only track.collaborators (accepted). So a freshly tagged collaborator is invisible on the track page until they accept — even to the owner. Whether the owner should see an "invite pending" chip there is a product call, left alone here.

Verification

  • Ruled out the client transform: ran the real trackMetadataForUploadToSdkPublishTrackSchema pipeline with a collaborator present; description, tags and collaborator ids all survive to the on-chain write.
  • Ruled out the indexer: track_create.go inserts description/tags unconditionally and reconciles collaborators separately.
  • New regression tests in UploadTrackForm.test.ts — 2 of the 5 cases fail against the old code and pass with the fix.
  • tsc --noEmit and eslint clean on the touched files.

Caveat

I could not reproduce the reporter's exact session end-to-end, so this is a mechanism that matches every observed symptom (including the Electronic genre fallback and release_date == created_at) rather than a confirmed repro.

🤖 Generated with Claude Code

…tialize

EditTrackForm runs Formik with `enableReinitialize`, so it resets the whole
form whenever `initialValues` deep-changes. UploadTrackForm built those values
by spreading `track.metadata` and then hard-overwriting description, tags,
stems, isrc and iswc with blanks, plus a fresh `new Date()` every recompute.

`formState.tracks` is rewritten with the user's edits on every submit, and
EditPage.onContinue calls `setFormState` while still on the edit phase (before
the upload confirmation modal resolves). So pressing "Complete Upload"
recomputes `initialValues`, Formik resets, and the description and tags the
user typed are blanked. Publishing from that point uploads an empty
description and no tags, while title/genre/mood/artwork survive because they
come from the `...track.metadata` spread — and an emptied genre then falls
back to the adapter's `Electronic` default.

Prefer values already on `track.metadata` over the `initialMetadata` seed, and
drop the `releaseDate` key: it was dead (the adapter reads `release_date`) and
minting a new Date on every call guaranteed a reset on every recompute.

Reported in #eng: a track published with the description, tags and collaborator
all missing right after upload.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3ba7c9a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers merged commit 3ed0e12 into main Aug 18, 2026
17 checks passed
@dylanjeffers
dylanjeffers deleted the fix/upload-form-wipes-description-and-tags branch August 18, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant