-
Notifications
You must be signed in to change notification settings - Fork 6
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
Throw errors when job.complete is given invalid data #247
Comments
Thanks for reporting this. Hmmmm... this is a very strange behaviour, and I don't know that a run-time type guard here is the best place to address this in the system. I would expect that if no error is thrown by the gRPC API call to Zeebe that the CompleteJob operation completed successfully. I tested this scenario, and I see what you report: the gRPC API throws no error, the process does not throw an incident and the job is not completed. The job is sent for a retry, but because it doesn't fail on the client, no retry decrement occurs (retry decrement is the responsibility of the client making the FailJob RPC call). Thus, the job goes into an infinite retry loop. I will check with the Zeebe engineering team. I have a vague memory of this coming up a few years ago. Let me look into it. |
We'll guard against it in the client immediately - I don't know at what point they'll be able to re-engineer the API. The new REST API endpoint for completing a job (in 8.6) throws a 400 if you try to post an array to it. |
The |
SDK Component
Zeebe
Expected Behavior
When passing an array of data to
job.complete
, I would expect an error to be thrown since zeebe doesn't seem to be able to properly deal with arrays.Current Behavior
Possibly related to: #236
Currently passing an array of data to job.complete (
job.complete([{ var1: 1 }])
) does not throw an error, and the token is stuck on that taskPossible Solution
In
parseVariablesAndCustomHeadersToJSON
, addAlso if there's any other values that would cause this behavior, it would be nice to have those explicitly thrown
Steps to Reproduce
When handling a
ZeebeJob
, pass an array of data intojob.complete
job.complete([{ var1: 1 }] as any)
Notice that the token is stuck with no incidents reported, and no errors thrown
Context (Environment)
I know the typing for
complete
technically doesn't allow arrays, due to a type assertion we ended up accidentally passing an array. While this was easy to fix, it was difficult to diagnose the issue since from addingconsole.logs
it seemed like everything ran successfullyThe text was updated successfully, but these errors were encountered: