christianselig / apollo-bugs

A public bug tracker for Apollo, an iOS Reddit app
227 stars 15 forks source link

User profile loads forever when not logged in #1218

Closed CasperCL closed 3 years ago

CasperCL commented 3 years ago

Describe the bug When I click on a user’s username, I normally get redirected to their profile that lists their posts/comments. If I am not logged in to any Reddit account, clicking on their username sends me to a page with no data, just a spinning icon. If I log into my Reddit account in Apollo, I can see the user profile normally. If I sign out, the issue returns.

To Reproduce Steps to reproduce the behavior:

  1. Quit Apollo
  2. Open Apollo and logout if logged in
  3. Go to any subreddit (f.e. /r/apple)
  4. Click on the username of poster of a post from the overview
  5. Get presented with a forever spinning loading indicator

iOS version: 14.4 Apollo version: 1.10.6 iOS device: iPhone 12 Jailbroken: No Reproducible: I can reproduce it every fime I’m logged out.

Expected behavior I expect the user’s profile to be displayed.

Additional context I’ve Apollo pro activated. The issue is fairly recent and I’m almost certain it was introduced with the last update. Especially considering the fact that some new features were added wrt user profiles.

Miniland1333 commented 3 years ago

I am encountering the same issue where the user pages do not load when logged out but do when I am logged in. Looking at my logs, a potentially relevant message is

🦀 [Apr 2, 08:54:44.069] [1.10.6/83] : [AccountManager.swift/getApplicationOnlyAccount(_:)/473]: Have previous application only account cached that we're returning: <RDKClient: 0x103045d60, username: (null)>

In particular, the username: (null) seems like it could be part of the problem. In contrast, when logged in you actually see some relevant Reddit API errors in the logs:

🍏 [Apr 2, 08:47:04.342] [1.10.6/83] : [/-[RDKClient(Requests) taskWithMethod:path:parameters:completion:]_block_invoke/613]: Reddit API error. Endpoint: https://oauth.reddit.com/user/zenacomics/upvoted.json?api_type=json&limit=1&raw_json=1 | Error: Error Domain=RDKClientErrorDomain Code=402 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied, NSLocalizedFailureReason=You don't have permission to access this resource.}

I have logged in/out a few times in the app and can consistently reproduce this issue.

CasperCL commented 3 years ago

Confirmed fixed in 1.10.7. Much appreciated!