Search Issue Tracker

Won't Fix

Votes

0

Found in

2019.4.22f1

2020.3.3f1

2021.1.0b7

2021.2.0a4

Issue ID

1327513

Regression

Yes

JSON deserialization produces different results when comparing to other conversion methods

Serialization

-

Reproduction steps:
1. Open attached project "JsonUtilityCorruption.zip"
2. In Test Runner window, run tests for "ReproduceCorruptionTest"
3. Observe the tests

Expected result: The tests pass
Actual result: The tests fail with "Expected: <WWTK.Stickers.StickerInstanceManagerState> But was: <WWTK.Stickers.StickerInstanceManagerState>" error

Reproducible with: 2019.4.22f1, 2019.4.24f1, 2020.3.3f1, 2020.3.4f1, 2021.1.0b7, 2021.1.1f1, 2021.2.0a4, 2021.2.0a12
Not reproducible with: 2019.4.21f1, 2020.3.2f1, 2021.1.0b6, 2021.2.0a3
Could not test with: 2018.4.30f1 (console errors break project)

Notes:
Also reproduced on macOS

  1. Response avatar

    Resolution Note:

    The order that OnAfterDeserialization will be called on nested objects is not guaranteed, so an object should not assume that OnAfterDeserialization has already been called on a different object when doing its own initialization. A recent fix guarantees that SerializeReference fields will be fully initialized by the time OnAfterDeserialization is called. And it is also guaranteed that OnAfterDeserialization on the outer object would be called last. It is our recommended to trigger any initialization code that needs to span across nested objects to be triggered from the main object's OnAfterDeserialization callback, that is a safe way to avoid fragile dependencies on the order of callback execution.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.