Closed michelboaventura closed 5 months ago
Thanks @michelboaventura, that was indeed a regression. Dialyzer didn't help here and that condition is prohibitively difficult to replicate in tests because of the sandbox.
Thanks @sorentwo. Indeed. I tried reproduce it locally running a bunch of async tasks but was never able to do so.
@sorentwo not trying to rush anything but do you think it would be possible to cut a new release fixing this today? Thanks
@michelboaventura Done! Oban v2.17.12 is out with this specific fix.
Precheck
Environment
Current Behavior
Hey!
I have this simplified version of a worker on my project. The important part is the
create
method:Recently we've improved our visibility and started sending all sort of errors to Sentry. After that we started seeing a ton of errors on the
case
statement withincreate
similar to (I've unwrapped the error in a more legible format):According to Oban's doc and typespec
Oban.insert/1
should never return anything other than{:ok, job}
or{:error, error}
which makes this behavior odd. After looking at 400+ errors the only thing in common they have is theconflict?: true
flag, so after reading throughout Oban's source code I came across this line which seems to be returning only the job and only when a conflict happens. And since this line was changed a couple of days ago I believe this might be a regression.Expected Behavior
Oban.insert()
should only return{:ok, job}
or{:error, error}
.