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

NoMethodError when removing a step from a campaign #225

Open
rathboma opened this issue Nov 13, 2023 · 3 comments
Open

NoMethodError when removing a step from a campaign #225

rathboma opened this issue Nov 13, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rathboma
Copy link
Contributor

I removed a step from a campaign, but now I get the following error in the background cron job:

NoMethodError: undefined method `action' for nil:NilClass

It's happening at this line:

step.action.new(user: user, step: step).deliver_now

      def perform(_campaign, user, step)
        step.action.new(user: user, step: step).deliver_now
      end

step is nil, so this fails.

@joshuap
Copy link
Member

joshuap commented Nov 22, 2023

@rathboma thanks for reporting. Do you think there were some active jobs for that step when the change that removed it was deployed? We should probably add a guard for that. 🤔

@joshuap joshuap added the bug Something isn't working label Nov 22, 2023
@joshuap joshuap self-assigned this Nov 27, 2023
@joshuap
Copy link
Member

joshuap commented Dec 4, 2023

FYI, I've started on this but I'm still deciding the best way to handle it.

@rathboma
Copy link
Contributor Author

rathboma commented Dec 4, 2023

Yes, there could have been some active jobs that were not picked up properly after the restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants