# Same code works differently on different Cadence instances

**URL:** <https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293>\
**Category:** Community Support\
**Tags:** cadence\
**Created:** [July 27, 2020, 6:04pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293 "2020-07-27T18:04:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:04pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/1 "2020-07-27T18:04:12Z")

</div>

Hey, I have an issue where the same code works differently on different instances of cadence. I’ve introduced new field (namely deviceNotFoundError) in the activity result class and this field is not reflected at all in one cadence instance. Please find details below. If more details are required feel free to ask, as a new user I cannot include images 😕

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 27, 2020, 6:09pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/3 "2020-07-27T18:09:42Z")

</div>

Cadence/Temporal service doesn’t interpret input and output of activities. So all of the serialization/deserialization code belongs to the client SDKs. It looks like one of the processes wasn’t updated. Another possibility is that the update happened after that part of the workflow already executed.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:13pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/4 "2020-07-27T18:13:00Z")

</div>

On one instance of cadence I’ve created a brand new domain and I’ve boot up only one instance of the application (cadence workflow and activities implementation). I did the same thing on other instance of cadence. Same code and environment, same responses from API’s only cadence instances are different. There is a different behaviour on those instances, in particular one instance doesn’t show deviceNotFoundError field in activity result, where the other does.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 27, 2020, 6:15pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/6 "2020-07-27T18:15:35Z")

</div>

Cadence service doesn’t interpret the payloads, so the issue is with your code. I would try to look more carefully into the specific code versions your different deployments are running.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:19pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/7 "2020-07-27T18:19:28Z")

</div>

No luck there. I’m running the same code. I’ve verified this with debugger. The thing is, that one instance of Cadence seems to ignore deviceNotFoundError field. It’s properly mapped from the activity (it’s put as true as activity result) but in the workflow it deserialized as false as activity result and it is not relfected at all in Cadence UI.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:21pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/8 "2020-07-27T18:21:55Z")

</div>

Does Cadence save any kind of metadata related to activities? Does it store the schema on the tasklists?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 27, 2020, 6:22pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/9 "2020-07-27T18:22:39Z")

</div>

No, Cadence doesn’t store any metadata and treats all the payloads as opaque blobs. So the problem is clearly somewhere in the client.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:26pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/10 "2020-07-27T18:26:23Z")

</div>

Well. With debug session open I’m seeing that the activity result has this field present and set to true. Workflow worker get’s that same activity result field deserialized to false and not even visible in the Cadence UI. It doesn’t seem like client issue to me. Especially, that I’m able to run the same code on different instance of Cadence with no issue whatsoever.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 27, 2020, 6:35pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/11 "2020-07-27T18:35:33Z")

</div>

I would recommend looking in the debugger at serialized activity output as well.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 6:44pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/12 "2020-07-27T18:44:14Z")

</div>

Yeah, I’ve checked the byte stream that is being sent to Cadence as the activity result and it contains that field set to true.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 27, 2020, 6:59pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/13 "2020-07-27T18:59:41Z")

</div>

And the ActivityTaskCompletedEvent does not contain it? I just cannot imagine such situation.

---

<div class="post-metadata">

**Author:** ![Rabchinsky](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rabchinsky](https://community.temporal.io/u/Rabchinsky)\
**Post date:** [July 27, 2020, 7:02pm UTC](https://community.temporal.io/t/same-code-works-differently-on-different-cadence-instances/293/14 "2020-07-27T19:02:09Z")

</div>

Yes, ActivityTaskCompletedEvent does not contain it on one particular Cadence instance. I thought this might be related to domain, so I’ve created a new one, but same thing happened.
