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
[Bug]: Fix pdf scanner #16956
base: 11.2
Are you sure you want to change the base?
[Bug]: Fix pdf scanner #16956
Conversation
Review Checklist
|
Quality Gate passedIssues Measures |
$asset->setCustomSetting($asset::CUSTOM_SETTING_PDF_SCAN_STATUS, PdfScanStatus::UNSAFE->value); | ||
$note = 'unsafe'; | ||
} | ||
$asset->save(['versionNote' => 'PDF scan result:' . $note]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mhhh, this could be bad, if by uploading a pdf that takes 5 seconds to check, and within that time, it's replaced by a new one that takes 1 second, by the time it finishes the first task, it would add a newer version with a earlier date than the creation date of the latest one, or things like that.
That's probably why it uses saveAsset()
that avoid Versioning.
Is it async or sync?
Is it necessary vernsioNote? could it be moved to metadata?
Changes in this pull request
Resolves #16318
Requires pimcore/admin-ui-classic-bundle#498
Additional info
It seems the problem was that the sanitization would be re-dispatched on every reload and at least every 5 seconds, because the in progress is not saved and was always null
Also if processBackground is false, it's appearing as in progress all the time, due to the line above it.