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

Account switcher response parsing failed {"code":"SUCCESS","data":{"responseContext":{... #266

Closed
4 tasks done
JellyBrick opened this issue Mar 23, 2024 · 1 comment
Closed
4 tasks done
Labels

Comments

@JellyBrick
Copy link
Contributor

JellyBrick commented Mar 23, 2024

Checklist

  • I am able to reproduce the bug with the latest debug version (Android, Linux, Windows)
  • I've checked that there is no open or closed issue about this bug.
  • This issue contains only one bug.
  • The title of this issue accurately describes the bug.

Steps to reproduce

  1. Login with Headers
    (env: KR)

Expected behavior

It must be logged in.

Actual behavior

RuntimeException is thrown.

Screenshots / recordings

image
image

Logs

Caused by: kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 2: Encountered an unknown key 'code' at path: $
Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
JSON input: {"code":"SUCCESS","data":{"respo.....
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:598)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.failOnUnknownKey(AbstractJsonLexer.kt:593)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.handleUnknown(StreamingJsonDecoder.kt:257)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeObjectIndex(StreamingJsonDecoder.kt:243)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeElementIndex(StreamingJsonDecoder.kt:178)
	at com.toasterofbread.spmp.youtubeapi.AccountSwitcherEndpoint$$serializer.deserialize(AccountSwitcherEndpoint.kt:6)
	at com.toasterofbread.spmp.youtubeapi.AccountSwitcherEndpoint$$serializer.deserialize(AccountSwitcherEndpoint.kt:6)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107)
	at com.toasterofbread.spmp.ui.layout.youtubemusiclogin.YoutubeMusicLoginPage.LoginPage$onHeadersProvided(YoutubeMusicLoginPage.kt:365)
	... 24 more

SpMp version

0.3.0

SpMp platform

Windows

OS version

Windows 11

Additional information

->

data class AccountSwitcherEndpoint(val code: String, val data: Data) {

or

Set ignoreUnknownKeys as true.

@toasterofbread
Copy link
Owner

Thanks, the project migrated to Ktor and Kotlinx serialization recently so there are still a few lingering bugs.

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

No branches or pull requests

2 participants