Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to auto login #662

Open
doraeric opened this issue Nov 25, 2023 · 8 comments
Open

Not able to auto login #662

doraeric opened this issue Nov 25, 2023 · 8 comments

Comments

@doraeric
Copy link

doraeric commented Nov 25, 2023

I have configured Electron Mail to start automatically on boot with a persistent session. However, several months ago, it stopped maintaining the login status. Every time I boot up, I have to log in again, and I also have to go through a graphical captcha. I've tried deleting the config folder, but even after logging in, it still doesn't retain the login status the next time.

electron mail version: v5.2.2 (c5f76ec)

I found the error message in .config/electron-mail/log.log:

[2023-11-25 12:32:35.972] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"Unleash: unable to fetch feature toggles InactiveSession: Inactive session","line":171700,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.974] [error] src/web/browser-window/app/_accounts/account-view.component.ts AccountViewComponent webview event {"type":"console-message","level":3,"message":"Unleash: unable to fetch feature toggles InactiveSession: Inactive session","line":171700,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.977] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.977] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.978] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.978] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.978] [error] src/web/browser-window/app/_accounts/account-view.component.ts AccountViewComponent webview event {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.982] [error] src/web/browser-window/app/_accounts/account-view.component.ts AccountViewComponent webview event {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.983] [error] src/web/browser-window/app/_accounts/account-view.component.ts AccountViewComponent webview event {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:35.983] [error] src/web/browser-window/app/_accounts/account-view.component.ts AccountViewComponent webview event {"type":"console-message","level":3,"message":"Uncaught (in promise) InactiveSession: Inactive session","line":46056,"sourceId":"webclient://mail.proton.me/assets/index.767a7dc1.js?v=5.0.31.1"}
[2023-11-25 12:32:47.655] [error] src/electron-main/web-contents.ts {"type":"console-message","level":3,"message":"[object Object]","line":8680,"sourceId":"file:///opt/ElectronMail/resources/app.asar/app/web/browser-window/index.mjs"}
[2023-11-25 12:32:47.705] [error] src/web/browser-window/app/app.error-handler.service.ts {
  name: 'Error',
  message: 'Invocation timeout of calling "notification" method on "electron-mail:webview-api:primary" channel with 25000ms timeout',
  stack: 'Error: Invocation timeout of calling "notification" method on "electron-mail:webview-api:primary" channel with 25000ms timeout\n' +
    '    at <anonymous>:965:24\n' +
    '    at Observable.init [as _subscribe] (<anonymous>:5216:35)\n' +
    '    at Observable._trySubscribe (<anonymous>:3231:25)\n' +
    '    at <anonymous>:3225:121\n' +
    '    at Object.errorContext (<anonymous>:10349:16)\n' +
    '    at Observable.subscribe (<anonymous>:3223:26)\n' +
    '    at doInnerSub (<anonymous>:6939:58)\n' +
    '    at outerNext (<anonymous>:6933:40)\n' +
    '    at OperatorSubscriber._this._next (<anonymous>:5391:15)\n' +
    '    at Subscriber.next (<anonymous>:3637:123)'
}
@vladimiry
Copy link
Owner

The notification channels has to be setup, so the further "app <=> @electron webview" interaction logic works as designed, including secure persisting the active session for reuse it on the next app start. The log error indicates the issue with notification channel establishing, the timeout error.

Why this happens is unclear at the moment, as there is no error cause in the log, so the request for notification channel setup just hangs somewhere in the @electron/@chromium internals. Some other users experience similar issues, see #648 for example.

I guess I could disable the background throttling for webview's "webContents", and we see then if it increases the "app <=> @electron webview" interaction stability.

For now, if you run Linux, consider other package types, like for example flatpak-based one. Writing this because the issue like this might be potentially related to environment specifics (it stopped working for you a few months ago, for some reason, like for example update on your environment), and "flathub" comes with some environment isolation capabilities.

@lxgr-linux
Copy link

This is happening to me since the last update.

@doraeric
Copy link
Author

doraeric commented Dec 2, 2023

I tried flatpak-based version, and it works fine. There is no longer a need for a captcha, and the session remains valid the next time the app starts.
Maybe it's caused by the environment like you said.

@lxgr-linux
Copy link

For me this is back working on my arch system.

@vladimiry
Copy link
Owner

vladimiry commented Dec 12, 2023

@lxgr-linux thanks for the update.

Based on this issue, and other cases too, I could say that "app <=> @electron webview" interaction, on some systems and for so far unclear reason, is a sensitive area of @electron. As pointed before, for the next release, I'm going to disable background throttling for webview's "webContents" guessing that this might increase named interaction stability.

Another option is replacing "app <=> @electron webview" interaction with communication via the main @electron channel, used as a simple events/signals redirection thing. So instead of direct "app <=> @electron webview" interaction, the main process would be in the middle "app <=> main <=> @electron webview". Besides, this approach would likely benefit the "context isolation" enabling need as when I tried it before, the direct "app <=> @electron webview" interaction had some issue in relation to "context isolation". But this would increase the code complexity and would require some refactoring, so this approach is undesirable.

@vladimiry
Copy link
Owner

vladimiry commented Dec 12, 2023

I'm going to disable background throttling for webview's "webContents" guessing that this might increase named interaction stability.

The backgroundThrottling: false flag is already there for at least 3 years,

backgroundThrottling: false,

@sbstn87
Copy link

sbstn87 commented May 23, 2024

Hello,

any chances this will be fixed?

I also have this issue since November 2023 (Windows 10).

By the way, when I use Ferdium to login into ProtonMail, autologin works perfectly fine:

https://github.com/ferdium/ferdium-app

@vladimiry
Copy link
Owner

vladimiry commented May 23, 2024

The updated version sits in the wip branch, so you could assemble app build from that branch.

By the way, when I use Ferdium to login into ProtonMail, autologin works perfectly fine:

This is just a wrapper of a regular proton's webclient without any addition features, so it obviously uses proton's auto login approach (saved sessions). Totally different approach used here (addition features, custom sessions saving, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants