This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
In attach_story_data_to_stories(), don't overwrite existing fields #730
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.
Hey Hal!
I know you're superbusy with other stuff, but could you have a quick look?
In #729 (and possibly #725), it looks like
MediaWords::DBI::Stories::attach_story_data_to_stories()
used to reset$list_field
key to an empty arrayref on every call, thus making this subroutine not work when it was called multiple times, e.g. when data was being "attached" in chunks:backend/apps/webapp-api/src/perl/MediaWords/Controller/Api/V2/StoriesBase.pm
Lines 279 to 302 in 12a0c0e
I've now made the subroutine merge the input
$story_data
with whatever might already be in the parameter$stories
under$list_field
(if anything). There's also a test that verifies that the subroutine behaves as intended.Does it look good to you?