urlyy opened a new issue, #3058: URL: https://github.com/apache/fory/issues/3058
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/fory/issues) and found no similar issues. ### Version Rust Latest ### Component(s) Rust ### Minimal reproduce step This is a unittest will pass. ```rust use fory_core::Fory; use fory_derive::ForyObject; #[test] fn test_main() { #[derive(ForyObject, Debug, PartialEq)] #[fory(debug)] struct Demo { f1: i32, } let mut fory = Fory::default().compatible(true); fory.register::<Demo>(1).unwrap(); let expected_demo = Demo {f1: 1}; let bf = fory.serialize(&expected_demo).unwrap(); let actual_demo = fory.deserialize::<Demo>(&bf).unwrap(); assert_eq!(expected_demo, actual_demo); } ``` And add some println for `fory_read_compatible`: https://github.com/apache/fory/blob/09852a5c39e90eb0786a481de683fbc004018762/rust/fory-derive/src/object/read.rs#L643-660 ```rust let local_type_hash = meta.get_hash(); let remote_type_hash = type_info.get_type_meta().get_hash(); println!("local: {local_type_hash} remote: {remote_type_hash}"); if remote_type_hash == local_type_hash { println!("enter here"); <Self as fory_core::Serializer>::fory_read_data(context) } else { ...... ``` and run the unit test. Althouth it passes, the output is only ``` local: 0 remote: 170066286042854 ``` which means the local type_meta.hash is not updated after `TypeMeta::new`. Actually, when computing meta_hash, it was written only to type_def and not stored in TypeMeta::hash, causing some fast paths not to be used. ### What did you expect to see? In my demo upside, is expected to print `enter here` ### What did you see instead? not print `enter here` ### Anything Else? _No response_ ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- 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]
