Skip to content

[stable34] fix(session): handle session token conflicts outside of the transaction - #66710

Merged
artonge merged 1 commit into
stable34from
backport/65276/stable34
Nov 18, 2026
Merged

artonge merged 1 commit into
stable34from
backport/65276/stable34

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Backport of #65276

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

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

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

@artonge
artonge force-pushed the backport/65276/stable34 branch 3 times, most recently from 1cc66ee to 01bb691 Compare November 18, 2026 12:34
@artonge
artonge marked this pull request as ready for review November 18, 2026 12:34
@artonge
artonge requested review from a team as code owners November 18, 2026 12:34
@artonge
artonge requested review from Altahrim and removed request for a team November 18, 2026 12:34
@artonge
artonge force-pushed the backport/65276/stable34 branch from 01bb691 to c390970 Compare November 18, 2026 13:18
When two concurrent requests of the same session (e.g. with Apache/SSO
based login) try to create the session token, one of them fails with a
unique constraint violation. The recovery path then looked up the
existing token, but it ran inside the transaction opened by
createSessionToken(). On PostgreSQL the failed INSERT aborts the whole
transaction, so the lookup failed with "SQLSTATE[25P02]: current
transaction is aborted" and the request errored out.

Move the conflict handling from Token\Manager to Session so that it
runs after the transaction was rolled back.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Louis Chmn <louis@chmn.me>
@artonge
artonge force-pushed the backport/65276/stable34 branch from c390970 to c50f319 Compare November 18, 2026 15:37
@artonge
artonge merged commit 5bf2df6 into stable34 Nov 18, 2026
135 checks passed
@artonge
artonge deleted the backport/65276/stable34 branch November 18, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants