-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: serialization #3080
base: main
Are you sure you want to change the base?
fix: serialization #3080
Conversation
这会直接修改整个 Config 的序列化逻辑。请针对性修复 |
@@ -60,6 +61,7 @@ public final class Config implements Cloneable, Observable { | |||
.registerTypeAdapter(EnumBackgroundImage.class, new EnumOrdinalDeserializer<>(EnumBackgroundImage.class)) // backward compatibility for backgroundType | |||
.registerTypeAdapter(Proxy.Type.class, new EnumOrdinalDeserializer<>(Proxy.Type.class)) // backward compatibility for hasProxy | |||
.setPrettyPrinting() | |||
.setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可能导致其他问题。请针对性修复,不要更改此处。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体来说呢,有大整数必须double不能long的场景吗?这只是让gson先尝试序列化成long,如果解析失败还是double
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不只能改那一坨fromStorage的屎山了,我觉得大整数用double是十分少见的
应当针对性解决。超时关闭 |
不好评价,为人么有人序列化不直接写好class啊……
时间戳反序列化成了double,绝
解决了 #2620 (comment) 提到的重复登录的bug
作为进一步实现临时登录之前的一个小fix