Skip to content

Fix Slow logout on Chrome-like browsers - #42544

Merged
artonge merged 2 commits into
nextcloud:masterfrom
HLFH:fix-chrome-logout
Jan 8, 2024
Merged

Fix Slow logout on Chrome-like browsers#42544
artonge merged 2 commits into
nextcloud:masterfrom
HLFH:fix-chrome-logout

Conversation

@HLFH

@HLFHHLFH commented Jan 2, 2024

Copy link
Copy Markdown
Contributor

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

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

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 :)

Comment threadcore/Controller/LoginController.php Outdated
@szaimenszaimen added bug 3. to review Waiting for reviews labels Jan 2, 2024
@szaimenszaimen added this to the Nextcloud 29 milestone Jan 2, 2024

@szaimenszaimen left a comment

Copy link
Copy Markdown
Contributor

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

@szaimenszaimen changed the title Cancel PR #37405, remove regression codeFix Slow logout on Chrome-like browsersJan 2, 2024
@HLFH

HLFH commented Jan 4, 2024

Copy link
Copy Markdown
ContributorAuthor

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

HLFHand 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>
@HLFH
HLFH requested a review from artongeJanuary 6, 2024 05:23
@artonge

Copy link
Copy Markdown
Collaborator

Drone is not triggered. Merging.

@artonge
artonge merged commit d2f2ee2 into nextcloud:masterJan 8, 2024
@welcome

welcomeBot commented Jan 8, 2024

Copy link
Copy Markdown

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
Copy Markdown
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

HLFH commented Feb 10, 2024

Copy link
Copy Markdown
ContributorAuthor

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

@artonge

Copy link
Copy Markdown
Collaborator

/backport to stable28

@artonge

Copy link
Copy Markdown
Collaborator

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

$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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

👀

@blizzzblizzz mentioned this pull request Mar 5, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow logout on Chrome-like browsers

6 participants

@HLFH@artonge@nickvergessen@susnux@skjnldsv@szaimen