Initial loading of Mail app requires refresh every time [$50 awarded]
Steps to reproduce
- Go to nextcloud on the web.
- Click on apps and click on the mail app.
- Screen stays stuck loading, but if you hit refresh it will load.
Expected behaviour
It should load properly without refresh.
Actual behaviour
It never loads on the initial opening of the mail app.
Mail app
Mail app version: (see apps admin page) 0.6.2 Mailserver or service: (e.g. Outlook, Yahoo, Gmail, Exchange,...) Gmail Transport security - IMAP: (None, SSL, TLS, STARTTLS)
Transport security - SMTP: (None, SSL, TLS, STARTTLS)
Number of accounts: 1 Mail app version build date: (only if you are using a Nightly Build) N/A
Server configuration
Operating system: Ubuntu 14 Web server: nginx Database: mariadb PHP version: 7.0 Version: (see admin page) 11.0 Updated from an older version or fresh install: Migrated from 10 List of activated apps: Most of them
Client configuration
Browser: Google Chrome Operating system: Windows 7 Enterprise
The $50 bounty on this issue has been claimed at Bountysource.
Hey,
I think I'm seeing the same problem daily. I don't yet know why it fails to load, according to the FF js console it's CSP blocking the scripts. However, this does not happen if I navigate from the files app to the mail app, but when the browser restores the previous tabs/sessions.
FYI this also is problematic for other apps, I've seen the nc calendar having the exact same problem when I restored my FF tabs. It's really hard to reproduce, but it happens from time to time. AFAIK the CSP nonce is outdated when that happens. My current guess is that the remember-me refreshes the session, hence a new session id and a new csp nonce is generated and the old ones are invalid. cc @LukasReschke as discussed recently.
Also FYI: if this happens, the direct menu aka the new apps menu on the top left does not load, hence you don't get to select any apps. It just shows the three dots.
I'm still curious why people don't see that with the files app. If they did we surely would have gotten more similar reports 🤔
I am seeing this behaviour when Firefox restores the session. So preparation like in the original description. Then log off without closing Firefox, reboot and log in again. Firefox is set to be autostarted and tries to restore the previous session. However the mail app won't reload and show just the header bar without any interaction possible. A reload will make it work.
Yup, @foxbow, that's exactly what I observe on a regular basis. Happens both on desktop and FF for Android.
First success after a few months: I can now reproduce the issue. It happens whenever the server throws away the session information (e.g. because the session file is removed). To reproduce this, one can use php session files and manually delete them from the filesystem. You have to reload twice to get back to a working mail app.
To sum up my findings: in base.php we call OC_Response::addSecurityHeaders();, which retrieves the current csrf token and dumps all the fancy security stuff to the response. Later on, in the user session logic, we call CsrfTokenManager::refreshToken. Therefore the nonce used from this point on is different to the one set in the security headers -> 💥 .
Refreshing the token is triggered by the login with token logic here https://github.com/nextcloud/server/blob/91fc25c28c9e3bb1e2c438ab6f80af5963c178dc/lib/private/User/Session.php#L474.
Potential fix in https://github.com/nextcloud/server/pull/6360 🚀
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and questions.