RemoveIfExists does not remove jobs in Scheduled state

Tags: #<Tag:0x00007efd24e98d38>

We use IRecurringJobManager.AddOrUpdate to successfully schedule a job. In our test scenario, running the job throws NotImplementedException and keeps the job in Scheduled state, as seen in the hangfire.job table (using MSSQL storage). After “noticing” the error, we stop the job using IRecurringJobManager.RemoveIfExists, but the scheduled job remains and gets triggered by Hangfire.AutomaticRetryAttribute. This seems like a bug to me in that the scheduled jobs should be removed when I remove the schedule.

How can we trigger the removal of a scheduled job when removing the recurring job? We do not explicitly add or remove the AutomaticRetryAttribute but still consider this an illogical result after the recurring job has been removed.