Repository navigation
Conversation
Formatting only, no functional change. Done separately so the follow-up fix commit shows just the logic. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The update form seeds its file selections with empty placeholders for files already on the server (e.g. the Variable Annotation File). newDatasetUploads treated them as real uploads, so a title-only edit PUT a blank file over the stored VAF, and the form always looked changed. Mark placeholders explicitly and filter them out via newUpdateUploads, so submitUpdate skips the delete/PUT steps when nothing real was selected. Replacing the file with a real selection still works as before. Fixes #1956 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
Author
|
When merging before or after #1953 there will be a small conflict: This is a conflict due to prettier formatting only. The correct resolution is to keep the |
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.
Fixes #1956
Problem
Editing a dataset's title or summary when it already has a Variable Annotation File (VAF) failed with a blank-VAF error. The cause was in the update form:
UpdateFormControllerseedsdataPropertiesFileSelectionswith empty placeholders (newUploadContent('', fileName, 'text/plain')) for files already stored on the server, so the form can show their names.newDatasetUploadsflattened every selection into the upload list, placeholders included.submitUpdatethen saw a non-emptydataPropertiesFiles. The delete step skipped the existing file (its name was still listed), andsubmitPutPUT the placeholder's emptyFileas the new VAF.A related symptom:
hasUploadswas always true when a VAF existed, so the form always counted as changed and the "nothing to do" state could never occur.Fix
isPlaceholder, created bynewExistingFilePlaceholder).newUpdateUploads(state)wrapsnewDatasetUploads, drops placeholders fromdataPropertiesFiles, and leaves itundefinedwhen nothing real remains.submitUpdatealready skips the delete/PUT steps in that case.UpdateFormControllerandUpdateFormusenewUpdateUploads.newDatasetUploadsis unchanged, so the upload form is unaffected.There is no UI path to delete a VAF, so a placeholder only ever means "keep the existing file". Replacing it with a real selection works as before (the new file is uploaded; the old one is deleted if its name differs).
Reviewing
This is two commits so the logic is easy to read:
Format update-form and upload-content files with prettieris formatting only (the repo's pre-commit prettier hook reformats whole staged files, and these files weren't prettier-clean onmain). No functional change.Don't re-upload existing dataset properties files on editis the actual fix (65 insertions, 8 deletions).Testing
tscshows only the 3 existing errors insrc/index.tsx, none in the touched files.Note on #1953
#1953 also edits
UpdateFormController.tsx, on nearby but different lines. The changes are logically independent, but whichever merges second may need a small textual conflict resolved.🤖 Generated with Claude Code