-
Notifications
You must be signed in to change notification settings - Fork 6
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
_handleNewBearerToken()
florps on .slice()
#84
Comments
Hey, I just realised that I might be able to figure out WTF is up with tokenDetails if I peek into my Network tab at around the 7pm mark. brb. |
Request Response Looks legit? I saved the non-truncated data dump elsewhere in case somebody can make more sense of it than I can. |
D’oh! I updated the URL parsing code to use |
I guess that will be fixed in 2.9.4. |
Weird Glitch Detected?
I ran across this weird glitch while working on some ASM updates. Essentially, after returning to an idle webpage after 2 hours, the Panoptes Client goes, "Hmm, time to renew the bearer token" then suddenly goes "BLARP I'm dead"
While I fully expected the token to die after a lengthy timeout (this is why I went on a 2 hour tea-drinking binge, after all - for science! ) I didn't quite expect to see how it died: the code crashes at
oauth._handleNewBearerToken()
's console.log() line, which attempts to.slice()
anundefined
Debug Details
Setup: OSX+Chrome, panoptes-client 2.9.2
Steps taken:
Expected: After 2 hours of non-activity, login token (user session) should expire - any attempt to conduct user-only Panoptes requests should fail with a 401 or similar.
Actual: Exactly as expected, but with weird bonus console errors.
The ASM page when accessed after 7pm. Note the console messages.
The ".slice() of undefined" error traced to the oath.handleNewBearerToken() code
Analysis:
console.log('Got new bearer token', tokenDetails.access_token.slice(-6));
oauth._handleNewBearerToken()
received thetokenDetails
object, but for some reason it was missing the.access_token
property. (I was unable to trace what the value oftokenDetails
was, unfortunately.)tokenDetails
in the method didn't conform to expected data structures. And I'm not sure what's up with that.panoptes-client
2.9.3), what with thethis._deleteBearerToken()
no longer triggering beforereturn this._handleNewBearerToken(tokenDetails)
inoauth._refreshBearerToken()
🤷♂️console.log()
statement.Status
Unknown priority? Help, I have no idea if this is a minor issue, an edge case, or something that needs to be taken care of.
This may be tangentially related to #81, as any attempt to create a better token-refresh system may need to be aware of possible crashing in
_handleNewBearerToken
's unexpectedtokenDetails
.The text was updated successfully, but these errors were encountered: