Skip to content

perf(session): fetch document only once in SessionMiddleware - #9294

Merged
mejo- merged 1 commit into
mainfrom
chore/cache_document_in_middleware
Sep 29, 2026
Merged

mejo- merged 1 commit into
mainfrom
chore/cache_document_in_middleware

Conversation

@mejo-

@mejo- mejo- commented Sep 29, 2026

Copy link
Copy Markdown
Member

Endpoints that require both a document session and a matching base version etag (push, sync, save) looked up the document twice per request: once in assertDocumentBaseVersionEtag() and again in assertDocumentSession(). Keep the fetched document in the middleware for the rest of the request so both checks share one query.

Supersedes #5773.

Assisted-by: ClaudeCode:claude-opus-5.5

馃弫 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Endpoints that require both a document session and a matching base
version etag (push, sync, save) looked up the document twice per
request: once in assertDocumentBaseVersionEtag() and again in
assertDocumentSession(). Keep the fetched document in the middleware
for the rest of the request so both checks share one query.

Supersedes #5773.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5.5
@mejo-
mejo- merged commit bedc7c3 into main Sep 29, 2026
69 checks passed
@mejo-
mejo- deleted the chore/cache_document_in_middleware branch September 29, 2026 12:07
@mejo-

mejo- commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

/backport to stable35

@mejo-

mejo- commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

/backport to stable34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 鈽戯笍 Done

Development

Successfully merging this pull request may close these issues.

2 participants