This is a more refined fix for being able to invoke a workflow by name (#123, originally fixed in #128) that also allows workflows using Sorbet to be declared final (fixing #178). The object is now only dup'd before calling .singleton_class if it's a String.
Testing
Existing tests for starting workflows continue to pass (as do all other tests):
All specs (both unit and integration) pass on protobuf 3.19.1 with grpc 1.41.1. The underlying issue in protobuf for invoking by name was fixed in 3.20.0.
A simple workflow whose class and execute method are marked as final works without a runtime error. A test for this cannot be checked in without taking a new dependency on the Sorbet runtime. Code that I used to test this can be found at https://gist.github.com/jeffschoner/588ffec227506de7a8cd23d71889c42e
Summary
This is a more refined fix for being able to invoke a workflow by name (#123, originally fixed in #128) that also allows workflows using Sorbet to be declared final (fixing #178). The object is now only dup'd before calling
.singleton_class
if it's aString
.Testing
Existing tests for starting workflows continue to pass (as do all other tests):
I've also tested that,
execute
method are marked as final works without a runtime error. A test for this cannot be checked in without taking a new dependency on the Sorbet runtime. Code that I used to test this can be found at https://gist.github.com/jeffschoner/588ffec227506de7a8cd23d71889c42e