Dimillian / IceCubesApp

A SwiftUI Mastodon client
https://apps.apple.com/us/app/ice-cubes-for-mastodon/id6444915884
GNU Affero General Public License v3.0
4.88k stars 460 forks source link

Bug: Login issues with [REDACTED] #2058

Open distantcam opened 2 months ago

distantcam commented 2 months ago

Ok, bear with me on this.

I've been developing my own maston api compatible server, and I was having issues with login with icecubes.

I eventually found the issue, and fixed it on my server side, and I'm wondering if the same issue is presenting login issues from other implementations.

For me, the issue was case insensitivity of the Visibility flag in the timeline call after login. My server was returning Public but IceCubes wasn't recognizing that.

In https://github.com/Dimillian/IceCubesApp/blob/main/Packages/Models/Sources/Models/Status.swift this code

public enum Visibility: String, Codable, CaseIterable, Hashable, Equatable, Sendable {
  case pub = "public"
  case unlisted
  case priv = "private"
  case direct
}

I suspect overriding pub with a string like that breaks the case insensitivity of CaseIterable (I'm not a swift dev)

Anyway, hopefully this can help with some of the other login bugs like #1661 and #2038

Dimillian commented 2 months ago

I need to check; I thought all the JSON decoding was done in case insensitive. I can set it up if it's not.