GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

PoToken: Optimize po-token refresh logic

Open DaVinci9196 opened this issue 8 months ago • 3 comments

Solve the problem that the locally cached token is invalid and cannot be regenerated, causing YouTube playback to freeze.

DaVinci9196 avatar May 06 '25 06:05 DaVinci9196

Will this resolve #2831, #2789, #2354, #2352 & #2103?

Will this resolve #2831, #2789, #2354 & #2103?

Maybe, this pr is a refresh strategy, if the token is detected to be invalid, it will be regenerated and returned

DaVinci9196 avatar May 07 '25 01:05 DaVinci9196

I'm not sure if this will help and if this keeps happenning to other people but I fixed this issue https://github.com/microg/GmsCore/issues/2789 by dointg this.

I did a factory reset and installed the new version of microG, but I made sure to set device registration profile to real this time (it's important to do it before enabling device registration for the first time because after that the id was already generated and before adding your google account) and to enable allow apps to find accounts before adding my google account.

I don't know why it happened before and if it was fixed in the new version or if it happens only if you set it up in some other way (maybe adding the google account through an app or before enabling device registration or leaving device registration profile in native) but now it works fine.

leo20481141 avatar May 18 '25 01:05 leo20481141

@DaVinci9196, The issue isn’t that the access token needs refreshing. The issue is that the locally cached PoToken is invalid and must be regenerated — otherwise playback freezes. I tested this PR merged on one of my account which has playback issues and it didn't fix it.

So, YouTube playback freezes because the locally cached PoToken is invalid — this isn't an OAuth issue. On detection, the player should regenerate the PoToken via the appropriate internal method instead of relying on the cached one.