-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IQSS/10686 - fix dataset thumbnail #10687
Closed
qqmyers
wants to merge
3
commits into
IQSS:develop
from
QualitativeDataRepository:IQSS/10686-fix_dataset_thumbnail
Closed
IQSS/10686 - fix dataset thumbnail #10687
qqmyers
wants to merge
3
commits into
IQSS:develop
from
QualitativeDataRepository:IQSS/10686-fix_dataset_thumbnail
Conversation
This file contains 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
2024/07/18 - 6.4 proposal request from @poikilotherm |
landreev
added a commit
that referenced
this pull request
Sep 3, 2024
stevenwinship
pushed a commit
that referenced
this pull request
Sep 3, 2024
* This is the fix for the bug in its entirety. #10819 * Making dataset thumbnail auto-selection optional (but enabled by default) #10819 * release note for the PR. #10819 * added a size == 0 check to DatasetUtil.getThumbnail (copied from #10687) #10819 * Added instructions on how to fix the files and datasets affected by the bug to the release note. #10819 * 2 extra words added to the release note #10819 * droped TIF from the error message in the thumbnail widgets, since it's not supported. (#10819)
IQSS/10686-fix_dataset_thumbnail
Since the same basic fix was in #10820, I'll close this. |
PaulBoon
pushed a commit
to DANS-KNAW/dataverse
that referenced
this pull request
Oct 2, 2024
* This is the fix for the bug in its entirety. IQSS#10819 * Making dataset thumbnail auto-selection optional (but enabled by default) IQSS#10819 * release note for the PR. IQSS#10819 * added a size == 0 check to DatasetUtil.getThumbnail (copied from IQSS#10687) IQSS#10819 * Added instructions on how to fix the files and datasets affected by the bug to the release note. IQSS#10819 * 2 extra words added to the release note IQSS#10819 * droped TIF from the error message in the thumbnail widgets, since it's not supported. (IQSS#10819) (cherry picked from commit 92d3839)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Consider For Next Release
A simple change (eg bug fix) that would be good to prioritize since it has been seen in the wild
Size: 3
A percentage of a sprint. 2.1 hours.
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 this PR does / why we need it: This PR resolves a recently (v6.3) introduced bug that can cause a dataset thumbnail to appear as a broken link and for a datafile to unnecessarily show the default icon rather than a thumb. Further details are in the issue.
Which issue(s) this PR closes:
Closes #10686
Special notes for your reviewer:
The fix is to send the real size (400) rather than 0 from the dataset.xhtml by adding the importConstants call to allow ImageThumbConverter.DEFAULT_PREVIEW_SIZE to be used. It appeared necessary to also add the final keyword to the constant in ImageThumbConverter for this to work, so I added final to all of them there. I also added a check to see if size==0 ever occurs and to avoid going through the logic that would set the persistent previewimagefail flag on the file.
To fix files where that flag has been set by this bug, one can call the /clearThumbnailFailureFlag api as described in the release note. I could add a flyway script for this, but the failure flag could have been set for other (real) reasons and doing so would cause all of those files to retry thumb generation on their next call. So rather than do that automatically, I though adding the api call (or letting people call it just for specific files) might be better. I don't have a strong opinion (we didn't have the fail flag not too long ago so retries were happening then.)
Strangely, this problem appears to be new at QDR (where #5621 came from) although the line of code in question was there already. I don't know what else might have changed - perhaps we are now catching the size==0 error and setting the flag whereas before that was a silent fail (only affecting the logic in the og header) and retry (showing a good thumb in pages).
Suggestions on how to test this:
I was able to trigger this by adding an image file, seeing the thumb created in the dataset, then going to the main page which triggers the logic to select a thumb for the dataset. Once that has happened, going back to the dataset page and making an edit, e.g. changing the metadata, causes the problem - I think the file thumb disappears immediately and going back to the main page/refreshing will cause the dataset thumb to show a broken link. Adding the PR should stop any new occurrences. To fix one that's broken, you have to call the /clearThumbnailFailureFlag as in the release note.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
included
Additional documentation: