File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,21 @@ def task_list
5151 private
5252
5353 def has_executable_concern? ( object )
54- # NOTE: When object is a String .dup is needed since Object#singleton_class mutates
55- # it and screws up C extension class detection (used by Protobufs)
56- object . dup . singleton_class . included_modules . include? ( Concerns ::Executable )
54+ if object . is_a? ( String )
55+ # NOTE: When object is a String, Object#singleton_class mutates it and
56+ # screws up C extension class detection used in older versions of
57+ # the protobuf library. This was fixed in protobuf 3.20.0-rc1
58+ # via https://github.com/protocolbuffers/protobuf/pull/9342.
59+ #
60+ # Creating a duplicate of this object prevents the mutation of
61+ # the original object which will be put into a protobuf payload
62+ # before being sent to Temporal server. Because duplication fails
63+ # when Sorbet final classes are used, duplication is limited only
64+ # to String classes.
65+ object = object . dup
66+ end
67+
68+ object . singleton_class . included_modules . include? ( Concerns ::Executable )
5769 rescue TypeError
5870 false
5971 end
You can’t perform that action at this time.
0 commit comments