Skip to content

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

Merged
artonge merged 1 commit into
stable33from
backport/65276/stable33
Nov 18, 2026
Merged

artonge merged 1 commit into
stable33from
backport/65276/stable33

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/stable33 branch from 49f0c4c to 2ec56ca Compare November 18, 2026 12:36
@artonge
artonge marked this pull request as ready for review November 18, 2026 12:37
@artonge
artonge requested review from a team as code owners November 18, 2026 12:37
@artonge
artonge requested review from salmart-dev and removed request for a team November 18, 2026 12:37
@artonge
artonge force-pushed the backport/65276/stable33 branch from 2ec56ca to bb04f63 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/stable33 branch from bb04f63 to 7da7aee Compare November 18, 2026 15:37
@artonge
artonge merged commit 4a1cc2a into stable33 Nov 18, 2026
163 checks passed
@artonge
artonge deleted the backport/65276/stable33 branch November 18, 2026 16:09
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