Conversation
What was broken: Uploaded challenge attachments disappeared from the editor after saving a draft. Root cause: The challenge editor reset its form state from the patch response, and when that response omitted attachments the locally managed attachment list was overwritten. What was changed: Preserved the current attachment list when the saved challenge payload does not include attachments, while still using persisted attachment data when it is returned. Any added/updated tests: Added a ChallengeEditorForm regression test covering the save flow when the update response omits attachments.
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.
What was broken
Uploaded challenge attachments disappeared from the challenge editor after saving a draft.
Root cause (if identifiable)
The editor reset form state from the patch response, and when that response omitted attachments it overwrote the locally managed attachment list.
What was changed
Preserved the current attachment list when the saved challenge payload does not include attachments, while still preferring persisted attachment data when the API returns it.
Any added/updated tests
Added a ChallengeEditorForm regression test that covers saving after an attachment upload when the update response omits attachments.