winston icon indicating copy to clipboard operation
winston copied to clipboard

[Bug] JSON issue, loading any data from Reddit not possible

Open winnybot opened this issue 1 year ago • 2 comments

Describe the bug Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.decodingFailed(error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character '<' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character '<' around line 1, column 1.})))))

To Reproduce Steps to reproduce the behavior:

  1. Open the app
  2. reload

Expected behavior loading my subreddits and stuff

Device (please complete the following information): iPhone 15 Pro iOS 17.0.3

winnybot avatar Oct 23 '23 10:10 winnybot

Was able to find the reason for the issue: When setting up the app, after giving Winston permission to use the Reddit API Key (the screen where it shows "open winston" or "go to winston" afterward I don't remember exactly) it will start the app and show an "everything set up" screen. If the app crashes at that point and will be started manually afterward, the issue like I described above will show up. If the app doesn't crash at that point, everything will be set up correctly and there are no issues.

In my case, the app crashed at that point because my Pi-Hole prevented it from loading something, so it never reached the "everything set up" screen. After starting the app again it didn't try to load again whatever it tried loading before (even without Pi-Hole), so it seems like the set-up process wasn't finished, but winston doesn't realize that the setup process was not finished completely, so the error occurs.

Flatric avatar Oct 23 '23 10:10 Flatric

Yeah Winston currently doesn't actually check if the API key actually works or is set correctly and it will always say that everything is working. This is definitely something we should fix @Kinark.

frostplexx avatar Oct 23 '23 10:10 frostplexx