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

API token used for Talk-API not refreshed correctly in all cases #4179

Closed
marten opened this issue Nov 24, 2017 · 1 comment
Closed

API token used for Talk-API not refreshed correctly in all cases #4179

marten opened this issue Nov 24, 2017 · 1 comment
Labels

Comments

@marten
Copy link
Contributor

marten commented Nov 24, 2017

I think the token used for API calls to talk.zooniverse.org does not get refreshed when it's expired, unless you actually go to Talk. This causes an issue when you have an old tab open, and go from anywhere but Talk over to your private messages. At this point, it seems that PFE keeps using the expired token to make the API call to https://talk.zooniverse.org/conversations. This causes the Talk-API to reject the request with an HTTP 401 status.

This 401 status in turn is not handled correctly by PFE, which just assumes that this means you have no private messages, rather than showing an error message.

Expected behavior

Clicking on "Messages (1)" lists my private messages, with one conversation marked as unread.

And secondarily, any authentication errors should be messaged accordingly to the user, rather than assuming an empty response body.

Current behavior

The page I get to when I click on "Messages (1)" tells me I don't have any messages.

image

The console explains what's going on:

image

Refreshing the page once here loads the messages correctly.

Steps to replicate

  • Open zooniverse.org
  • Wait for a long time until your OAuth token expires
  • Click messages

Additional information

@marten marten added the bug label Nov 24, 2017
@eatyourgreens
Copy link
Contributor

The Talk client seems to be missing the beforeEveryRequest hook that's used in the Panoptes client.

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