itchio / itch

🎮 The best way to play your itch.io games
https://itch.io/app
MIT License
2.36k stars 209 forks source link

Contributing: Current `master` starts up properly but can't proceed after Captcha #2992

Closed 3ter closed 7 months ago

3ter commented 7 months ago

It starts up

$ npm start

> kitch@26.1.5-canary start
> node develop.js

then I log in and solve the Captcha

13:23:30.814 DEBUG (rcall) Calling Profile.List
13:23:38.447 DEBUG (mcall) Calling Fetch.Commons
13:23:47.603 INFO (m/reac/login) Attempting password login for user <email>
13:23:47.604 INFO (m/reac/login) Doing username/password login...
13:23:47.604 DEBUG (mcall) Calling Profile.LoginWithPassword
13:23:47.604 DEBUG (m/reac/login) Setting up handlers for TOTP & captcha
13:23:47.895 INFO (m/reac/login) Showing captcha
13:24:18.845 DEBUG (mcall) Calling Fetch.Commons

and then it stays here image

I already tried bringing that to attention in the Discord channel but got no reaction so far.

rockiesmagicnumber commented 7 months ago

yeah me too - the captcha succeeds but never progresses past that auth itch.log

3ter commented 7 months ago

@alts I hope you don't mind me pinging you for this, but could you please shed some light on how to build the app properly. It seems that https://itch.io/docs/itch/developing/getting-started.html is not really enough to get you up to speed.

alts commented 7 months ago

@alts I hope you don't mind me pinging you for this, but could you please shed some light on how to build the app properly. It seems that https://itch.io/docs/itch/developing/getting-started.html is not really enough to get you up to speed.

Oof, I'm sorry about that. @3ter, thank you for the ping, I'll dig into this later today.

alts commented 7 months ago

An update, since I'm signing off for the day.

Short version: I'm making progress, and will have this fixed by Monday.

More details for those interested: The Electron upgrades I've implemented broke some assumptions of the app, and I thought I'd caught them all, but clearly I missed this one. The way that the captcha works is that it assumes various parts of the app have direct access to the window object of the captcha webview. As of Electron 12, this will fail silently. I've replaced the direct access in the preload script with the contextBridge, which resolves the preload script's dependence on window, but the main application still polls the window object to check for the captcha results, which isn't permitted either. I'll probably have to add some explicit IPC event, and then thread the handling of the event down to the captcha modal to close it.

rockiesmagicnumber commented 7 months ago

Oh silent failures. I'm pretty sure MS built MAUI on a lattice of nested silent failures.

alts commented 7 months ago

@3ter could you confirm that the captcha is working for you in my branch? alts/ipc-captcha

3ter commented 7 months ago

@alts Yes, I can confirm the login is working now, thank you for your work!

By the way, do you know why the captcha is so "hard". Usually I don't need like 4, 5 screens to pass it, but with this app it seems more tedious then on other sites.

EDIT: Your branch seems to contain changes unrelated to the electron ipc fix (e.g. src/renderer/modal-widgets/PlanInstall/index.tsx). And there are unused imports. I didn't want to be intrusive in opening a PR for you, but I would have liked to, so I could refer to the code in question more easily: would you have thought that out of place?

rockiesmagicnumber commented 7 months ago

Concur, login is working from alts/ipc-captcha. Thank you for the quick turnaround.

alts commented 7 months ago

I didn't want to be intrusive in opening a PR for you, but I would have liked to, so I could refer to the code in question more easily: would you have thought that out of place?

Wouldn't have been out of place at all. Go for it! And thank you for the detailed bug report, it helped a lot in resolving this.

do you know why the captcha is so "hard"

I'll admit I don't know, but I get the sense that it may be adaptive? The first couple I did were easy, but in the course of testing over and over, it ramped up very quickly.

Your branch seems to contain changes unrelated...

The extra commit is due to a divergence between the Github version of the codebase and the private Gitlab one (with CI and some other functionality). Usually the two of them are kept in sync, but I never moved this commit over. Sorry! 🙇

alts commented 7 months ago

The fix has been merged into master

3ter commented 7 months ago

@alts Thank you for your answers, I appreciate it.

I would like to ask you some more questions if possible. I'm going to choose Mastodon for it.