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

Add missing @EncodeDefault annotation to MALOAuth #1682

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

MajorTanya
Copy link
Contributor

@MajorTanya MajorTanya commented Jan 30, 2025

Similar to the situation with Bangumi, the missing annotation means kotlinx.serialization would provide the default value upon instantiation but not serialise it to disk. This means the isExpired() calculation would effectively rarely/never do its job correctly, leading to Mihon sending expired tokens to MAL and causing problems for everyone involved.

Overall, this change could (should) lead to a drastic reduction in MAL requests failing, leading to users having to relink their MAL accounts.

Also switched createdAt to be in seconds instead of milliseconds as all other trackers use seconds for timestamps (except for AniList, which uses milliseconds but doesn't use a createdAt timestamp anyway).

MIGHT solve the underlying issues of #724, #1065, and probably others I can't find right now.

Similar to the situation with Bangumi, the missing annotation means
kotlinx.serialization would _provide_ the default value upon
instantiation but not serialise it to disk. This means the isExpired()
calculation would effectively rarely/never do its job correctly,
leading to Mihon sending expired tokens to MAL and causing problems
for everyone involved.

Overall, this change _could_ (should) lead to a drastic reduction in
MAL requests failing, leading to users having to relink their MAL
accounts.

Also switched createdAt to be in seconds instead of milliseconds as
all other trackers use seconds for timestamps (except for AniList,
which uses milliseconds but doesn't use a createdAt timestamp anyway).
@MajorTanya MajorTanya force-pushed the maybe-fix-mal-erroring branch from db011dc to 60be524 Compare January 30, 2025 15:35
@AntsyLich AntsyLich enabled auto-merge (squash) January 30, 2025 15:42
@AntsyLich AntsyLich merged commit 29ec7c1 into mihonapp:main Jan 30, 2025
1 check passed
@MajorTanya MajorTanya deleted the maybe-fix-mal-erroring branch January 30, 2025 15:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants