oppia / oppia

A free, online learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
5.63k stars 3.78k forks source link

Fix #19110: Copy translation's target exploration images regardless if submitter uploaded new images or not #20188

Closed StephenYu2018 closed 1 week ago

StephenYu2018 commented 3 weeks ago

Overview

This PR fixes #19110.

This PR does the following:

The original bug occurred because images in the translation's target exploration were copied in GCS File System from /exploration/... to /exploration_suggestions/... only when the translation submitter uploaded new images to the translation text. If a translation reviewer were to review that submitted translation, the images would not load since they must be fetched from /exploration_suggestions/....

The PR that introduced this bug is #16532, in particular this commit. Prior to these changes, suggestion images were uploaded as long as it wasn't a question suggestion (in other words, a translation suggestion). Those changes introduced a check to only upload suggestion images if the list of new images introduced by the translation submitter was not empty. It's also possible that it was trying to check that the list of new images wasn't None.

Essential Checklist

Please follow the instructions for making a code change.

Proof that changes are correct

Before: issue-19110-proof-before

After: issue-19110-proof-after

Proof of changes on desktop with slow/throttled network

https://github.com/oppia/oppia/assets/117241994/a0dc714f-a5fd-497a-8376-7706d4017061

Proof of changes on mobile phone

https://github.com/oppia/oppia/assets/117241994/bf81b67d-5f08-408f-a96d-9ea6640a5368

Proof of changes in Arabic language

https://github.com/oppia/oppia/assets/117241994/46076e6d-001e-4207-b6aa-cee2b4ca4df1

PR Pointers

oppiabot[bot] commented 3 weeks ago

Hi @vojtechjelinek, @DubeySandeep, @kevintab95, PTAL at this PR, it modifies files in jobs or platform folders.
Also @StephenYu2018, please make sure to fill in the server jobs form for the new job or feature to be tested on the backup server. This PR can be merged only after the test run is successful. Please refer to this guide for details.
Thanks!

oppiabot[bot] commented 3 weeks ago

Assigning @chris7716 for the first pass review of this PR. Thanks!

StephenYu2018 commented 3 weeks ago

@chris7716 @kevintab95 If the only datastore change is to raise an error when copying files in the case of the given source asset not existing, do I still have to do server testing for this behavior? If so, then I think I'll just revert this behavior back to what it originally was, since I'm aiming to get this PR merged by April 30th latest.

oppiabot[bot] commented 3 weeks ago

Assigning @lkbhitesh07 for code owner reviews. Thanks!

seanlip commented 2 weeks ago

@chris7716 @kevintab95 If the only datastore change is to raise an error when copying files in the case of the given source asset not existing, do I still have to do server testing for this behavior? If so, then I think I'll just revert this behavior back to what it originally was, since I'm aiming to get this PR merged by April 30th latest.

Server testing isn't needed here -- thanks for checking.

seanlip commented 2 weeks ago

@chris7716 @lkbhitesh07 PTAL as codeowners, thanks.

StephenYu2018 commented 2 weeks ago

@seanlip I've responded to some of your review comments asking for clarifications on a few things.

oppiabot[bot] commented 2 weeks ago

Unassigning @chris7716 since they have already approved the PR.

oppiabot[bot] commented 2 weeks ago

Hi @StephenYu2018, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

StephenYu2018 commented 1 week ago

@seanlip @chris7716 @kevintab95 Can you merge this PR now? The CI checks have passed.