z-huang / InnerTune

A Material 3 YouTube Music client for Android
GNU General Public License v3.0
4.85k stars 295 forks source link

When logged in - display nickname and email in the settings instead of an empty space #932

Closed netrunner-exe closed 1 year ago

netrunner-exe commented 1 year ago

Checklist

Feature description

When logged in - display nickname and email in the settings instead of an empty space.

Why do you want this feature?

It seems to me that it will look much better than just an empty space.

Current: Screenshot_2023-08-04-14-28-19-070_com zionhuang music debug

Proposed: IMG_20230804_143320

Additional information

No response

z-huang commented 1 year ago

Can you find any network request error from the logs? (keyword: ktor) The app does make a request to get your name and email after logged in. I think there're different outputs from youtube that makes response parsing fail.

netrunner-exe commented 1 year ago

Can you find any network request error from the logs? (keyword: ktor) The app does make a request to get your name and email after logged in. I think there're different outputs from youtube that makes response parsing fail.

I will try. If possible, tell me in more detail how best to write these logs and with what. Those logs that I usually posted earlier are crash reports that are tritely displayed by the android itself. If you write in more detail how best to do this, then I think it will be useful for everyone to better help you solve some issues. Thank you.

netrunner-exe commented 1 year ago

I will try to take logs with Android Studio today.

wongwengtim commented 1 year ago

Not sure if this helps. No error log from io.ktor.client.network.sockets. I captured the possible request/response from browser.

image

image

netrunner-exe commented 1 year ago

@z-huang I capture log using logcat in Android Studio. Starting from the moment of login to the account. I don't know how useful it will be. logcat.txt

owencz1998 commented 1 year ago

@z-huang was that meant to be fixed as I've still got the issue even after updating 😅

Screenshot_20230806_134905_InnerTune Debug.jpg

z-huang commented 1 year ago

Go into the webview, wait for the webpage to load, and return. You're name and email will show.

owencz1998 commented 1 year ago

@z-huang So click on login again and wait for the website to load if so that didn't work

wongwengtim commented 1 year ago

@owencz1998 Clear app data and try again.

owencz1998 commented 1 year ago

@wongwengtim just tried but didn't fix the issue

z-huang commented 1 year ago

@owencz1998 If that isn't the case, I need logs because there may be other problems.

owencz1998 commented 1 year ago

No worries ill see if I can get software to run again due to laptop issues

netrunner-exe commented 1 year ago

The problem is not solved in any way, but the issue is closed...

z-huang commented 1 year ago

If you can't get your name and email shown, please provide logs. I want to solve this before releasing 0.5.2.

wolf-yuan-6115 commented 1 year ago

If you can't get your name and email shown, please provide logs. I want to solve this before releasing 0.5.2.

Hello, I have same issue and 2FA is enabled on my account. It might be the reason.

netrunner-exe commented 1 year ago

If you can't get your name and email shown, please provide logs. I want to solve this before releasing 0.5.2.

Hello, I have same issue and 2FA is enabled on my account. It might be the reason.

Exactly! Why didn't I think about 2FA right away... If you log in with an account without 2FA, everything shows up correctly. That was the problem! @z-huang, is there any way to fix it? It would be nice to show something like "No saved playlists" instead of a blank window if there are no playlists in the account.

z-huang commented 1 year ago

I also have 2FA enabled, but it works well...

wolf-yuan-6115 commented 1 year ago

I also have 2FA enabled, but it works well...

I just tried with my other account without 2FA, still the same issue. But after logging into both accounts, it just stays at the YouTube music homepage, is that normal?

MLZ94 commented 1 year ago

@z-huang i got this issue too so here is a logcat (taken with basic "adb logcat". if you prefer something else let me know and i'll give it too).

here is then steps i did

let me know if you want further details

wolf-yuan-6115 commented 1 year ago

logcat.txt @z-huang i got this issue too so here is a logcat (taken with basic "adb logcat". if you prefer something else let me know and i'll give it too).

here is then steps i did

* launche adb logcat (phone was on innertune home menu, and it's already logged in to an account)

* open innertune settings

* open connectivity settings (the page to log in into the account. not sure what's the english string for it)

* click on the account avatar (the name is not displayed)

* let web view show yt music menu

* come back to innertune settings

* the name is still not displayed

* end logcat capture

let me know if you want further details

You've sent whole logcat, here is some meanful part:

Click for detail ``` 09-01 14:41:52.280 3656 14074 W System.err: io.ktor.serialization.JsonConvertException: Illegal input 09-01 14:41:52.280 3656 14074 W System.err: at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:79) 09-01 14:41:52.280 3656 14074 W System.err: at io.ktor.serialization.kotlinx.KotlinxSerializationConverter$deserialize$1.invokeSuspend(Unknown Source:15) 09-01 14:41:52.280 3656 14074 W System.err: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 09-01 14:41:52.280 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.280 3656 14074 W System.err: at kotlinx.serialization.json.Json.decodeFromString(Json.kt:95) 09-01 14:41:52.280 3656 14074 W System.err: at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:71) 09-01 14:41:52.280 3656 14074 W System.err: ... 7 more 09-01 14:41:52.281 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:162) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$$serializer.deserialize(AccountMenuResponse.kt:7) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$$serializer.deserialize(AccountMenuResponse.kt:7) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: ... 9 more 09-01 14:41:52.281 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:162) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:533) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: ... 15 more 09-01 14:41:52.281 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:162) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$$serializer.deserialize(AccountMenuResponse.kt:11) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$$serializer.deserialize(AccountMenuResponse.kt:11) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: ... 24 more 09-01 14:41:52.281 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:162) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$$serializer.deserialize(AccountMenuResponse.kt:15) 09-01 14:41:52.281 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$$serializer.deserialize(AccountMenuResponse.kt:15) 09-01 14:41:52.281 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.281 3656 14074 W System.err: ... 30 more 09-01 14:41:52.286 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing at path: $.actions[0].openPopupAction.popup.multiPageMenuRenderer.header.activeAccountHeaderRenderer 09-01 14:41:52.286 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:90) 09-01 14:41:52.286 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) 09-01 14:41:52.286 3656 14074 W System.err: at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) 09-01 14:41:52.286 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:162) 09-01 14:41:52.286 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$Popup$MultiPageMenuRenderer$Header$$serializer.deserialize(AccountMenuResponse.kt:27) 09-01 14:41:52.286 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$Popup$MultiPageMenuRenderer$Header$$serializer.deserialize(AccountMenuResponse.kt:27) 09-01 14:41:52.286 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.286 3656 14074 W System.err: ... 47 more 09-01 14:41:52.287 3656 14074 W System.err: Caused by: kotlinx.serialization.MissingFieldException: Field 'email' is required for type with serial name 'com.zionhuang.innertube.models.response.AccountMenuResponse.Action.OpenPopupAction.Popup.MultiPageMenuRenderer.Header.ActiveAccountHeaderRenderer', but it was missing 09-01 14:41:52.287 3656 14074 W System.err: at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20) 09-01 14:41:52.287 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$Popup$MultiPageMenuRenderer$Header$ActiveAccountHeaderRenderer.(AccountMenuResponse.kt:31) 09-01 14:41:52.287 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$Popup$MultiPageMenuRenderer$Header$ActiveAccountHeaderRenderer$$serializer.deserialize(AccountMenuResponse.kt:31) 09-01 14:41:52.287 3656 14074 W System.err: at com.zionhuang.innertube.models.response.AccountMenuResponse$Action$OpenPopupAction$Popup$MultiPageMenuRenderer$Header$ActiveAccountHeaderRenderer$$serializer.deserialize(AccountMenuResponse.kt:31) 09-01 14:41:52.287 3656 14074 W System.err: at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) 09-01 14:41:52.287 3656 14074 W System.err: ... 53 more ```
MLZ94 commented 1 year ago

yeah actually that's the part you need, i'll avoid spreading my entire logcats. let me know if you still need more details

z-huang commented 1 year ago

There's no email field in your response, so the app can't get your email. Can you provide the response of account_menu from your web browser?

image

z-huang commented 1 year ago

Current fix is to ignore the missing email.

There's no email field in your response, so the app can't get your email. Can you provide the response of account_menu from your web browser?

This is still required to fully fix the bug.

netrunner-exe commented 1 year ago

Current fix is to ignore the missing email.

There's no email field in your response, so the app can't get your email. Can you provide the response of account_menu from your web browser?

This is still required to fully fix the bug.

@z-huang, almost fixed. Now it shows nickname, email still doesn't show.

owencz1998 commented 1 year ago

Same for me it's showing username 1 step closer lol yay

MLZ94 commented 1 year ago

Current fix is to ignore the missing email.

There's no email field in your response, so the app can't get your email. Can you provide the response of account_menu from your web browser?

This is still required to fully fix the bug.

Can you elaborate about the steps i need to follow to give you the informations you want ?

z-huang commented 1 year ago
screenshot
MLZ94 commented 1 year ago

I emailed you the output for privacy reasons. Tell me if you need something else.

wolf-yuan-6115 commented 1 year ago

I think I found the problem, if you have an account that have created a channel, email won't come up because it's showing your channel handel.

Screenshots:

Account with channel created, and have configured a channel username: image

Account without a channel, no username set: image

Same account as above one, after creating channel: image

MLZ94 commented 1 year ago

That's right. For my account which has a channel, it's showing the channel handle as channelHandle instead of my full email. It would be fine if the app try to catch both and returns the one that is not null