Skip to content

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

Merged
artonge merged 1 commit into
stable35from
backport/65276/stable35
Nov 18, 2026
Merged

artonge merged 1 commit into
stable35from
backport/65276/stable35

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/stable35 branch 3 times, most recently from 9c62160 to ca7a95e Compare November 18, 2026 12:29
@artonge
artonge marked this pull request as ready for review November 18, 2026 12:30
@artonge
artonge requested review from a team as code owners November 18, 2026 12:30
@artonge
artonge requested review from icewind1991 and removed request for a team November 18, 2026 12:30
@artonge
artonge force-pushed the backport/65276/stable35 branch from ca7a95e to 11a70f8 Compare November 18, 2026 13:19
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/stable35 branch from 11a70f8 to cc0c191 Compare November 18, 2026 15:37
@artonge
artonge enabled auto-merge November 18, 2026 16:13
@artonge
artonge merged commit f158763 into stable35 Nov 18, 2026
248 of 254 checks passed
@artonge
artonge deleted the backport/65276/stable35 branch November 18, 2026 16:43
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