Repository navigation
[stable35] fix(session): handle session token conflicts outside of the transaction - #66711
Merged
Merged
Conversation
backportbot
Bot
requested review from
CarlSchwan,
artonge and
cristianscheid
November 18, 2026 08:19
artonge
approved these changes
Nov 18, 2026
artonge
force-pushed
the
backport/65276/stable35
branch
3 times, most recently
from
November 18, 2026 12:29
9c62160 to
ca7a95e
Compare
artonge
marked this pull request as ready for review
November 18, 2026 12:30
cristianscheid
approved these changes
Nov 18, 2026
artonge
force-pushed
the
backport/65276/stable35
branch
from
November 18, 2026 13:19
ca7a95e to
11a70f8
Compare
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
force-pushed
the
backport/65276/stable35
branch
from
November 18, 2026 15:37
11a70f8 to
cc0c191
Compare
artonge
enabled auto-merge
November 18, 2026 16:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #65276
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.