Change hook names to be more delayed-job specific #1060
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.
This aims to change the delayed job hooks to have more specific names to avoid collisions. Because of
performable_method
, many objects can be turned into delayed job payload objects. If those objects happen to define methods with names like "before", "after", "error", or "success", those methods will be called by the job runner. This can cause surprising bugs and behaviors. (A similar problem is mentioned in this pr #943)This aims to change the names of those methods to be more specific to running delayed jobs to make them harder to collide with accidentally.
This is a breaking change, so we could also do work to phase this change in more slowly if it's desirable (deprecate hooks with the old names, run new or old hook name -- whichever is present -- and then remove the old hook names in a following version)