-
-
Notifications
You must be signed in to change notification settings - Fork 304
MBS-14075: Adjust edits_pending for entities with open relationship edits
#3581
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
base: master
Are you sure you want to change the base?
Conversation
reosarevok
left a comment
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.
This seems good in general, and could probably be merged as is - I see three very similar if not entirely the same additions to the files though and it kinda feels like we should try and share the code as much as possible? But if it's harder than it looks, go ahead with this.
It doesn't seem to be needed except for the `edit_category`, and this causes problems in a later commit where the role will start requiring consumers to implement `directly_related_entities`.
… edits I can't think of any reason we shouldn't do this, and it will prevent the RemoveEmpty script from deleting entities that only have pending relationship edits, as was the case in MBS-14075.
|
@reosarevok I realized all of the entity gathering was already implemented before in There's a bigger issue here. This PR makes the problem from the original ticket worse, because I believe the reason this issue doesn't occur in the Perl tests is that they run inside a transaction, and Fixing this is a schema change. And I'm mostly leaning towards removing these triggers now (a missed opportunity from last schema change...). |
| with 'MusicBrainz::Server::Edit::Role::Insert', | ||
| 'MusicBrainz::Server::Edit::Role::AlwaysAutoEdit'; | ||
|
|
||
| sub edit_category { l('Relationship') } |
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.
Was this really the only purpose of Edit::Relationship here? 🫠 I guess edit_category is required for stats and stuff... wonder if we have more cases where we are importing a bunch of useless stuff just for a category?
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.
Not quite the only purpose :) Undefined subroutine &MusicBrainz::Server::Edit::Relationship::EditLinkType::l. Will amend.
So the suggestion would be to just let URLs be autoremoved more slowly via the usual entity process? It will slow down spam removal a bit but probably something we can live with. Is there a need to wait until the next schema change with this? These triggers are not in mirrors, right? So couldn't we update our own triggers now, and release to standalones in October? |
We could probably just move RemoveEmpty from daily.sh to hourly.sh if it's an issue. Or at least reduce the
Right, none of these triggers are on mirrors. No problem at all with dropping them in production before October. |
In that case I'd suggest adding that to this PR, because it probably cannot be merged anyway until we do so since it would make things worse :) (or, if you feel it's cleaner, I guess it could be better to have a second PR and ticket for that and mark this as blocked by it) |
|
Changed to draft since it needs the schema change to be mergeable without making things worse. |
Problem
When a relationship edit is left open, we don't adjust
edits_pendingfor any of the endpoints, only the relationship itself. Which allows any of the linked entities to be auto-removed by the RemoveEmpty script before the edit closes.I can't think of any reason we shouldn't do that.
Testing
Added new automated tests.