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

Fix Slow logout on Chrome-like browsers #42544

Merged
merged 2 commits into from Jan 8, 2024

Conversation

HLFH
Copy link
Contributor

@HLFH HLFH commented Jan 2, 2024

Summary

It cancels PR #37405, removes all the regression code.
This issue is it has been 9 months than the logout takes 30 seconds on Chrome-like browsers since this PR.
If anything was interesting in the highly damaging PR #37405, I highly recommend to add any feature-related PR in a separate PR, as this one is only meant to fix a critical bug, which makes Nextcloud unusable.

Checklist

@karlitschek

Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the HTTPS check :)

core/Controller/LoginController.php Outdated Show resolved Hide resolved
@szaimen szaimen added bug 3. to review Waiting for reviews labels Jan 2, 2024
@szaimen szaimen added this to the Nextcloud 29 milestone Jan 2, 2024
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the changes by @artonge

@szaimen szaimen changed the title Cancel PR #37405, remove regression code Fix Slow logout on Chrome-like browsers Jan 2, 2024
@HLFH
Copy link
Contributor Author

HLFH commented Jan 4, 2024

I signed-off your commit. @artonge
I don't know if we need to add anything in LoginControllerTest.php with your commit.

HLFH and others added 2 commits January 5, 2024 04:20
Signed-off-by: Gaspard d'Hautefeuille <github@dhautefeuille.eu>
nextcloud#41196 + keep https check

Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Gaspard d'Hautefeuille <github@dhautefeuille.eu>
@artonge
Copy link
Contributor

artonge commented Jan 8, 2024

Drone is not triggered. Merging.

@artonge artonge merged commit d2f2ee2 into nextcloud:master Jan 8, 2024
49 checks passed
Copy link

welcome bot commented Jan 8, 2024

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@nickvergessen
Copy link
Member

Drone is not triggered. Merging.

Drone is actually red due to this PR:

Runtime:       PHP 8.2.14
Configuration: phpunit-autotest.xml

FFF............                                                   15 / 15 (100%)

Time: 00:00.049, Memory: 30.00 MB

There were 3 failures:

1) Tests\Core\Controller\LoginControllerTest::testLogoutWithoutToken
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
 OCP\AppFramework\Http\RedirectResponse Object (
     'headers' => Array (
         'Location' => '/login'
-        'Clear-Site-Data' => '"cache", "storage"'
     )
     'cookies' => Array ()
     'status' => 303

/home/nickv/Nextcloud/29/server/tests/Core/Controller/LoginControllerTest.php:160

2) Tests\Core\Controller\LoginControllerTest::testLogoutNoClearSiteData
Expectation failed for method name is "isUserAgent" when invoked 1 time(s).
Method was expected to be called 1 times, actually called 0 times.

3) Tests\Core\Controller\LoginControllerTest::testLogoutWithToken
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
 OCP\AppFramework\Http\RedirectResponse Object (
     'headers' => Array (
         'Location' => '/login'
-        'Clear-Site-Data' => '"cache", "storage"'
     )
     'cookies' => Array ()
     'status' => 303

/home/nickv/Nextcloud/29/server/tests/Core/Controller/LoginControllerTest.php:214

Drone is configured to no longer work on forks due to some security implications.

It is recommended to fork the PR into our org for now when they are good.

Can you follow up to make CI green again?

@HLFH
Copy link
Contributor Author

HLFH commented Feb 10, 2024

@artonge Can this with #42633 be backported for stable-28 branch? For 28.0.3 release :)

@artonge
Copy link
Contributor

artonge commented Feb 12, 2024

/backport to stable28

@artonge
Copy link
Contributor

artonge commented Feb 12, 2024

@HLFH can you ensure that #42633 is included in the created PR?

if (
$this->request->getServerProtocol() === 'https' &&
!$this->request->isUserAgent([Request::USER_AGENT_CHROME, Request::USER_AGENT_ANDROID_MOBILE_CHROME])
) {
$response->addHeader('Clear-Site-Data', '"cache", "storage"');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have been fixed in the master pr. Instead of excluding Chrome just drop the cache part.

Thats what slows chrome down, because of a 7 years old chrome bug...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow logout on Chrome-like browsers
6 participants