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

[stable27] fix(Session): avoid race conditions on clustered setups #46435

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jul 11, 2024

Backport of #46398

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Remove all the empty commits

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

$this->tokenProvider->invalidateToken($sessionId);
$this->tokenProvider->generateToken($sessionId, $uid, $loginName, $pwd, $name, IToken::TEMPORARY_TOKEN, $remember);
$this->atomic(function () use ($sessionId, $uid, $loginName, $pwd, $name, $remember) {
$this->tokenProvider->invalidateToken($sessionId);

Check failure

Code scanning / Psalm

UndefinedThisPropertyFetch Error

Instance property OC\User\Session::$tokenProvider is not defined
- re-stablishes old behaviour with cache to return null instead of throwing
  an InvalidTokenException when the token is cached as non-existing
- token invalidation and re-generation are bundled in a DB transaction now

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
prefer to keep this check as PublicEmitter should be dropped sooner or
later

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz marked this pull request as ready for review July 11, 2024 08:39
@blizzz blizzz requested review from Altahrim, a team, yemkareems and sorbaugh and removed request for a team July 11, 2024 08:39
@blizzz blizzz merged commit 38a6c50 into stable27 Jul 11, 2024
40 of 41 checks passed
@blizzz blizzz deleted the backport/46398/stable27 branch July 11, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants