snooze icon indicating copy to clipboard operation
snooze copied to clipboard

Unserialization fails when constucter parameter given as Model was deleted

Open sakcaysoftware opened this issue 1 year ago • 1 comments

Hi there, We use this package for long times. First of all thanks for this package.

Recently I noticed for an exception called UnserializeFailedException. This exception is thrown because the constucter parameter given as Model was deleted before execution. Laravel offers a property called $deleteWhenMissingModels for notification classes. In case of ModelNotFoundException Laravel deletes the job and terminates execution if this property is set to true.

Code_72ACQ4V02L

Here is the unserialization stage for this package. Exception thrown here because model was deleted before. (Because laravel calls query with firstOrFail()). We can determine a property for this situtation to handle like Laravel.

sakcaysoftware avatar Sep 25 '24 13:09 sakcaysoftware

Accordingly, it tries to resend each time for the time specified in the snooze.sendTolerance config. And as you can guess, an error is thrown for each time and a log is written.

sakcaysoftware avatar Sep 25 '24 13:09 sakcaysoftware

we're facing the same issue here, hope the pull request will be merged 'soon' ;)

schmeits avatar Dec 16 '24 09:12 schmeits

Closed in https://github.com/thomasjohnkane/snooze/releases/tag/2.7.0 :)

atymic avatar Dec 16 '24 09:12 atymic