Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: serialization #3080

wants to merge 1 commit into from

Conversation

zly2006
Copy link
Contributor

@zly2006 zly2006 commented May 27, 2024

不好评价,为人么有人序列化不直接写好class啊……
时间戳反序列化成了double,绝

解决了 #2620 (comment) 提到的重复登录的bug

作为进一步实现临时登录之前的一个小fix

@burningtnt
Copy link
Member

这会直接修改整个 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能导致其他问题。请针对性修复,不要更改此处。

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要不只能改那一坨fromStorage的屎山了,我觉得大整数用double是十分少见的

@burningtnt
Copy link
Member

应当针对性解决。超时关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants