SwiftcordApp / Swiftcord

A fully native Discord client for macOS built 100% in Swift!
https://swiftcordapp.github.io/Swiftcord/
GNU General Public License v3.0
1.85k stars 84 forks source link

[Bug]: Stuck logging in #167

Closed AstralNexus25 closed 11 months ago

AstralNexus25 commented 1 year ago

Describe the Bug

Bug Description I enter my username and password, click Log In, and it keeps loading. I've tried different macOS versions (Sonoma dev beta and Ventura), tried different Swiftcord versions, even reinstalled macOS altogether. (dw I backed it up) I tried a different user account and it turns out that works. That account was inactive for a long time, and I had not updated the username to the latest non-#xxxx format. It is possible that that was the issue, but it really shouldn't be.

Actual Behaviour Entered username, password, click Log In, stuck on spinning discord logo.

Expected Behavior It.. loads?

Reproducing the Bug

1... Log In 2...Wait.. 3...Wait... ... Log out ig

Version

0.6.1

Category

Login

Relevant Log Output

No response

Screenshots

Start screen

SCR-20230723-rets

Login

SCR-20230723-rewz-2

Loading screen

SCR-20230723-rfau

Eventually the "This is taking a while, want to log out?" button appears

SCR-20230723-rfco

It crashes after a while (like 5 minutes)

SCR-20230723-rgtv

Additional Info

I did try a different legacy username account (by legacy I mean it still had the #xxxx ending), and surprisingly it logged in fine. This probably isn't useful since it is (hopefully) really unlikely that this is an issue, but just wanted to put that out. Thanks!

Edit: Attaching the Problem Details and System Configuration log that shows up in the "Swiftcord quit unexpectedly" message if that helps.

Problem Details and System Configuration.txt

crystall1nedev commented 1 year ago

Leaving this here:

evaluna@Evas-MacBookPro181 ~ % /Applications/Swiftcord.app/Contents/MacOS/Swiftcord 
2023-07-26T03:52:37-0400 info RobustWebSocket : version=9 ws=wss://gateway.discord.gg/?v=9&encoding=json&compress=zlib-stream [DiscordKitCore] [CONNECT]
2023-07-26T03:52:37-0400 warning RobustWebSocket : [DiscordKitCore] Reconnection in progress, not reconnecting
2023-07-26T03:52:37-0400 info RobustWebSocket : [DiscordKitCore] [CONNECTED]
2023-07-26T03:52:37-0400 info RobustWebSocket : heartbeat_interval=41250 [DiscordKitCore] [HELLO]
2023-07-26T03:52:37-0400 info RobustWebSocket : intents=nil [DiscordKitCore] [IDENTIFY]
2023-07-26T03:52:38-0400 warning RobustWebSocket : error=dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "d", intValue: nil), CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "premium_type", intValue: nil)], debugDescription: "Cannot initialize PremiumType from invalid Int value 3", underlyingError: nil)) [DiscordKitCore] Error decoding message
cryptoAlgorithm commented 1 year ago

Oh, this is a different issue from the other hang on login problem. Looks like this is due to Discord adding a new PremiumType, by any chance do your account(s) have Discord Nitro Basic?

AstralNexus25 commented 1 year ago

Oh, this is a different issue from the other hang on login problem. Looks like this is due to Discord adding a new PremiumType, by any chance do your account(s) have Discord Nitro Basic?

Nope, neither of my accounts have nitro.

crystall1nedev commented 1 year ago

Oh, this is a different issue from the other hang on login problem. Looks like this is due to Discord adding a new PremiumType, by any chance do your account(s) have Discord Nitro Basic?

Mine does, at least.

cryptoAlgorithm commented 1 year ago

@crystall1nedev Your issue appears to be a separate one from the OPs. Please open a separate issue (as it is due to unrecognised discord premium types).

egor-ryashin commented 1 year ago

I have the same issue, but no logs in the directory. I wonder how to debug it?

therealhubbit commented 1 year ago

same issue as op here

egor-ryashin commented 1 year ago

I've got this from debug logging

2023-08-06T22:54:55+0300 info RobustWebSocket : version=9 ws=wss://gateway.discord.gg/?v=9&encoding=json&compress=zlib-stream [DiscordKitCore] [CONNECT]
2023-08-06T22:54:56+0300 debug RobustWebSocket : reason=connection is reachable [DiscordKitCore] Reset backoff
2023-08-06T22:54:56+0300 warning RobustWebSocket : [DiscordKitCore] Reconnection in progress, not reconnecting
2023-08-06T22:54:56+0300 info RobustWebSocket : [DiscordKitCore] [CONNECTED]
2023-08-06T22:54:56+0300 trace DecompressionEngine : decompressed.count=124 original.count=114 [DiscordKitCore] Decompressed data
2023-08-06T22:54:56+0300 debug RobustWebSocket : reason=Hello payload received [DiscordKitCore] Invalidating conn timeout
2023-08-06T22:54:56+0300 info RobustWebSocket : heartbeat_interval=41250 [DiscordKitCore] [HELLO]
2023-08-06T22:54:56+0300 debug RobustWebSocket : interval=41.25 [DiscordKitCore] Start heartbeating
2023-08-06T22:54:56+0300 info RobustWebSocket : intents=nil [DiscordKitCore] [IDENTIFY]
2023-08-06T22:54:56+0300 trace RobustWebSocket : data=GatewayIdentify(token: "*", properties: DiscordKitCore.GatewayConnProperties(os: DiscordKitCore.PropertiesOS.macOS, browser: "Discord Client", device: nil, release_channel: Optional("canary"), client_version: Optional("0.0.283"), os_version: Optional("22.5.0"), os_arch: Optional("arm64"), system_locale: Optional("en-US"), client_build_number: Optional(115689)), compress: Optional(false), large_threshold: nil, shard: nil, presence: Optional(DiscordKitCore.GatewayPresenceUpdate(since: 0, activities: [], status: DiscordKitCore.PresenceStatus.online, afk: false)), client_state: Optional(DiscordKitCore.ClientState(guild_hashes: DiscordKitCore.GuildHashes(), highest_last_message_id: "0", read_state_version: 0, user_guild_settings_version: -1, user_settings_version: -1)), capabilities: Optional(1021), intents: nil) opcode=identify seq=-1 [DiscordKitCore] Outgoing Payload
2023-08-06T22:54:57+0300 trace DecompressionEngine : decompressed.count=2916079 original.count=453598 [DiscordKitCore] Decompressed data
2023-08-06T22:54:57+0300 warning RobustWebSocket : error=keyNotFound(CodingKeys(stringValue: "application", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "d", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"application\", intValue: nil) (\"application\").", underlyingError: nil)) [DiscordKitCore] Error decoding message
Blind-Joe commented 1 year ago

Same problem here. Infinite loading after login / qr code scan on just bought macbook m1

aljustiet commented 1 year ago

Same problem too

randompea commented 1 year ago

same.

zeronullempty commented 1 year ago

Ditto

RWCoding58 commented 1 year ago

Same, both phone number and email don't work. Strangely, it knows my account's using two-factor auth, but it doesn't load after entering the code.

cryptoAlgorithm commented 1 year ago

@Blind-Joe @aljustiet @randompea @zeronullempty @RWCoding58 could you guys try out this nightly build? It contains fixes which might resolve your issue. The build is also available through Swiftcord's Discord server, so do join that for the latest updates and faster support.

RWCoding58 commented 1 year ago

@Blind-Joe @aljustiet @randompea @zeronullempty @RWCoding58 could you guys try out this nightly build? It contains fixes which might resolve your issue. The build is also available through Swiftcord's Discord server, so do join that for the latest updates and faster support.

nope, still stuck for me

AstralNexus25 commented 1 year ago

@Blind-Joe @aljustiet @randompea @zeronullempty @RWCoding58 could you guys try out this nightly build? It contains fixes which might resolve your issue. The build is also available through Swiftcord's Discord server, so do join that for the latest updates and faster support.

This does fix some issues, but I still can't log in. If I use CMD+, I can enter settings, and my account name and details show up though!

SCR-20230829-sqee-2
cryptoAlgorithm commented 11 months ago

Swiftcord.zip

This build seems to fix this issue according to some people, in the Discord server, experiencing the same problem. Give it a shot! (Do note, as always, since this is an unsigned build you'll have to right click > open to get past the macOS warning)

@RWCoding58 @AstralNexus25

cryptoAlgorithm commented 11 months ago

Leaving this here:

evaluna@Evas-MacBookPro181 ~ % /Applications/Swiftcord.app/Contents/MacOS/Swiftcord 
2023-07-26T03:52:37-0400 info RobustWebSocket : version=9 ws=wss://gateway.discord.gg/?v=9&encoding=json&compress=zlib-stream [DiscordKitCore] [CONNECT]
2023-07-26T03:52:37-0400 warning RobustWebSocket : [DiscordKitCore] Reconnection in progress, not reconnecting
2023-07-26T03:52:37-0400 info RobustWebSocket : [DiscordKitCore] [CONNECTED]
2023-07-26T03:52:37-0400 info RobustWebSocket : heartbeat_interval=41250 [DiscordKitCore] [HELLO]
2023-07-26T03:52:37-0400 info RobustWebSocket : intents=nil [DiscordKitCore] [IDENTIFY]
2023-07-26T03:52:38-0400 warning RobustWebSocket : error=dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "d", intValue: nil), CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "premium_type", intValue: nil)], debugDescription: "Cannot initialize PremiumType from invalid Int value 3", underlyingError: nil)) [DiscordKitCore] Error decoding message

@crystall1nedev Could you check if the issue #170 is relevant to your issue? The build linked in the previous comment should also help.

AstralNexus25 commented 11 months ago

Swiftcord.zip

This build seems to fix this issue according to some people, in the Discord server, experiencing the same problem. Give it a shot! (Do note, as always, since this is an unsigned build you'll have to right click > open to get past the macOS warning)

@RWCoding58 @AstralNexus25

Yess! This build fixes all the issues mentioned in this post. Thanks for your help!

cryptoAlgorithm commented 11 months ago

Alright, thats great, hope this also resolves #170!

RWCoding58 commented 11 months ago

yep, login works now

khurshid-alam commented 11 months ago

It is not resolved for me. Tried latest release version from releases and attached zip from here on Air M1 Ventura.

I am getting these errors after logging in by scanning qr. I don't have anything premium. All free.

2023-10-11T15:00:37+0530 warning RobustWebSocket : [DiscordKitCore] Already reconnecting, not reconnecting
rerender server
rerender server
rerender server
2023-10-11T15:00:43+0530 info RobustWebSocket : version=9 ws=wss://gateway.discord.gg/?v=9&encoding=json&compress=zlib-stream [DiscordKitCore] [CONNECT]
2023-10-11T15:00:44+0530 info RobustWebSocket : [DiscordKitCore] [CONNECTED]
2023-10-11T15:00:44+0530 warning RobustWebSocket : error=The data couldn’t be read because it isn’t in the correct format. [DiscordKitCore] Error decoding message

It keeps repeating.

What could be the issue ?

@cryptoAlgorithm