Skip to content

remove deleted files from oc_share - #5129

Merged
schiessle merged 5 commits into
masterfrom
remove_deleted_shares_from_db
Oct 7, 2013
Merged

schiessle merged 5 commits into
masterfrom
remove_deleted_shares_from_db

Conversation

@schiessle

Copy link
Copy Markdown
Contributor

remove shares from database for a given file if the file was deleted, possible fix for #4836

Comment thread apps/files_sharing/lib/updater.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

executeAudited can throw exceptions which will break the whole hook processing - right?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@schiesbn any additional mechanisms planned? What if there already exist bad entries in the table? THX

@schiessle

Copy link
Copy Markdown
Contributor Author

any additional mechanisms planned? What if there already exist bad entries in the table?

We could provide a update script which checks for all entries in oc_shares if the source still exists and remove the row if not.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

We could provide a update script which checks for all entries in oc_shares if the source still exists and remove the row if not.

I think it can happen over time as well - there is no real guarantee the hooks for deletion are fired under each condition. Maybe we need a delete of rows as we hit the error that the share source could not be found

@schiessle

Copy link
Copy Markdown
Contributor Author

I think it can happen over time as well - there is no real guarantee the hooks for deletion are fired under each condition.

But if this happens we have a bug which needs to be fixed. This bug fix than can contain again a upgrade script to fix already broken installations.
If we take the assumption "there is no real guarantee the hooks are fired" serious than we can question every operation we perform triggered by a hook which would lead the whole hook system to absurdity.

@ghost

ghost commented Oct 4, 2013

Copy link
Copy Markdown

@MorrisJobke

Copy link
Copy Markdown
Contributor

👍

An update hook should fullfil the integrity of the tables. If there appear other problems and there are still orphaned entities in the database we have to fix the reason and not fix the effect of the reason. For this additional fix we have to fix previous broken installations by another update hook.

Just my two cents.

@karlitschek

Copy link
Copy Markdown
Contributor

👍

schiessle added a commit that referenced this pull request Oct 7, 2013
@schiessle
schiessle merged commit 981608c into master Oct 7, 2013
@MorrisJobke
MorrisJobke deleted the remove_deleted_shares_from_db branch October 7, 2013 09:09
@schiessle

Copy link
Copy Markdown
Contributor Author

backported to stable5: 632a2e1...6f617bd

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants