lzaeh commented on issue #2423: URL: https://github.com/apache/fory/issues/2423#issuecomment-3089961804
> Thank you for quick reply! If it is an issue in the source code, could you please link this thread with a ticket? There is no way to upgrade the version until it is going to work properly. So yes I will stay on the previous version. By the way I use Java for serialization and Golang for deserialization. I am very interested in the flag `withRefTracking=true`, because it also does not work with `XLANG` mode, at least in the previous version. Hi, I’ve looked into the issue based on the code example you provided — thank you for spotting and sharing it. In earlier versions where your code worked fine, cross-language support could still fail in certain cases. In the current version, some changes were introduced to fix what seemed to be a more critical issue, but they unfortunately introduced new problems — including the one you found. I’ve summarized the remaining known issues here: https://github.com/apache/fory/pull/2427 If you need to work with the current version, you might be able to avoid these issues by steering clear of the affected patterns. One thing worth mentioning: in your code sample you're using a slice, but in the description it's referred to as an array. In Go, slices and arrays are completely different types. Fortunately, the case in your code was easier to debug and fix. That said, support for slices and arrays is still not perfect in the current version — basic use cases work fine in Go itself, but cross-language compatibility still has problems. I'm still new to the project and trying to work through these issues. Sorry for the trouble, and thank you again for your feedback and patience! --- Regarding the withRefTracking option you mentioned — based on my understanding, Fory’s reference tracking mechanism naturally helps to: Prevent infinite loops caused by cyclic references, and Reduce the size of the serialized output in certain cases, which can help lower transmission overhead. For example, consider the following two tests: In the first test, with reference tracking enabled, the serialized output is significantly smaller in size. Without it, repeated strings are fully duplicated in the output, leading to much larger payloads. <img width="887" height="335" alt="Image" src="https://github.com/user-attachments/assets/c5a2f2bc-8bce-4af8-a4ba-b48fc90101cc" /> <img width="718" height="266" alt="Image" src="https://github.com/user-attachments/assets/6fc7cc98-df05-4404-a921-e30465f10942" /> In the second test, we demonstrate a cyclic reference scenario. The first screenshot shows that when reference tracking is disabled, Fory throws an error asking you to enable the option. <img width="978" height="547" alt="Image" src="https://github.com/user-attachments/assets/d61dfe3a-fec4-4ff4-834b-ae91240e6664" /> <img width="1104" height="320" alt="Image" src="https://github.com/user-attachments/assets/144d5f20-cbf5-4b00-8416-7f78b96210ee" /> The second screenshot shows that serialization proceeds normally once reference tracking is turned on. <img width="992" height="487" alt="Image" src="https://github.com/user-attachments/assets/466908fb-c451-4efc-a984-987d6f1e4b66" /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
