Skip to content

Crash when fetching user info at launch #262

@opatry

Description

@opatry

Describe the bug

Unexpected JSON token at offset 13: Expected start of the object '{', but had '"' instead at path: $.error JSON input: { "error": "invalid_request", "error_description": "Missing required parameter: refresh_token" }

See firebase console

To Reproduce
Steps to reproduce the behavior:

  1. ? launch the app ? in which conditions?

Expected behavior
No crash and proper launch

Full stacktrace

          Fatal Exception: O6.C: Unexpected JSON token at offset 13: Expected start of the object '{', but had '"' instead at path: $.error
JSON input: {
  "error": "invalid_request",
  "error_description": "Missing required parameter: refresh_token"
}
       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:587)
       at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:585)
       at kotlinx.serialization.json.internal.AbstractJsonLexer.unexpectedToken(AbstractJsonLexer.kt:789)
       at kotlinx.serialization.json.internal.StringJsonLexer.consumeNextToken(StringJsonLexer.kt:76)
       at kotlinx.serialization.json.internal.StreamingJsonDecoder.beginStructure(StreamingJsonDecoder.kt:102)
       at net.opatry.google.profile.UserInfoErrorResponse$Error$$serializer.deserialize(UserInfoErrorResponse.kt:33)
       at net.opatry.google.profile.UserInfoErrorResponse$Error$$serializer.deserialize(UserInfoErrorResponse.kt:33)
       at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
       at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
       at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
       at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
       at net.opatry.google.profile.UserInfoErrorResponse$$serializer.deserialize(UserInfoErrorResponse.kt:28)
       at net.opatry.google.profile.UserInfoErrorResponse$$serializer.deserialize(UserInfoErrorResponse.kt:28)
       at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
       at kotlinx.serialization.json.Json.decodeFromString(Json.kt:149)
       at net.opatry.tasks.app.presentation.UserViewModel.fetchUserInfo(UserViewModel.kt:139)
       at net.opatry.tasks.app.presentation.UserViewModel.access$fetchUserInfo(UserViewModel.kt:67)
       at net.opatry.tasks.app.presentation.UserViewModel$fetchUserInfo$1.invokeSuspend(UserViewModel.kt:12)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:266)
       at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:101)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
       at android.os.Handler.handleCallback(Handler.java:995)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loopOnce(Looper.java:288)
       at android.os.Looper.loop(Looper.java:393)
       at android.app.ActivityThread.main(ActivityThread.java:9535)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1005)

Returned Json

{
  "error": "invalid_request",
  "error_description": "Missing required parameter: refresh_token"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🪳 Something isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions