Skip to content
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

TASK: resource:clean followup #1678 #3275

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jan 24, 2024

While reading the code, looking for improvement, it seems tedious that we getIdentifierByObject just to findByIdentifier a few lines later.

This happened due to a funny history of back and forth.

At first - 2014 - resource:clean was introduced looping over the PersistentResource: 8a1ce0f

Then - 2016 - it was decided to save the sha1 and loop over them and retrieve the asset via findOneBySha1: 879fba1

But that did not improve the situation as described in #1678 and was removed again - 2019.

So in functionality we made a full round, im just here to followup on the last fix to restore the full state syntactically as it was once though of.

While reading the code, looking for improvement, it seems tedious that we `getIdentifierByObject` just to `findByIdentifier` a few lines later.

This happened due to a funny history of back and forth.

At first - 2014 - `resource:clean` was introduced looping over the PersistentResource
- neos@8a1ce0f

Then - 2016 - it was decided to save the sha1 and loop over them and retrieve the asset via `findOneBySha1`

But that did not improve the situation as described in neos#1678 and was removed again - 2019.

So in functionality we made a full round, im just here to followup on the last fix to restore the full state syntactically as it was once though of.
@mhsdesign mhsdesign force-pushed the task/resourceCleanFollowup1678 branch from 1b03888 to dd6fbe0 Compare January 24, 2024 21:58
There were three ways to answer

> Do you want to remove all broken resource objects and related assets from the database? (y/n/c)

But n(o) and c(ancel) both endet the script.
To simplify things only y/n will be accepted answers.
Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 by reading

Comment on lines -278 to -279
while (!in_array($response, ['y', 'n', 'c'])) {
$response = $this->output->ask('<comment>Do you want to remove all broken resource objects and related assets from the database? (y/n/c) </comment>');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems the cancel option was meant to be a hard stop while n would ask for each image.
This was NEVER implement that way not even for the first draft robert did. Thats why i removed cancel as its equivalent to no.

@mhsdesign mhsdesign merged commit 9f353e4 into neos:9.0 Mar 6, 2024
6 checks passed
@mhsdesign mhsdesign deleted the task/resourceCleanFollowup1678 branch March 6, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants