Skip to content

Conversation

@mcollovati
Copy link
Collaborator

Implement SessionExpiredHandler in TranslationFileRequestHandler to serve translations even when no active session exists. This allows i18n requests to work correctly with stateless authentication.

Fixes #23238

@mcollovati mcollovati added target/24.9 target/25.0 Cherry-pick to 25.0 branch labels Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Test Results

1 313 files  ±0  1 313 suites  ±0   1h 12m 23s ⏱️ - 2m 52s
9 323 tests +4  9 255 ✅ +4  68 💤 ±0  0 ❌ ±0 
9 776 runs  +3  9 700 ✅ +3  76 💤 ±0  0 ❌ ±0 

Results for commit 8c1382e. ± Comparison against base commit 130c605.

♻️ This comment has been updated with latest results.

@Artur-
Copy link
Member

Artur- commented Jan 17, 2026

What is the session used for in the handler?

@Artur-
Copy link
Member

Artur- commented Jan 17, 2026

Apparently it is not used at all, but there is no way to have a request handler that does not care about the session?

@mcollovati
Copy link
Collaborator Author

Exactly. Request Handlers are invoked after the attempt to create/get a Vaadin session is already done.
Maybe a workaround could be implement it as a Vaadin interceptor, but it doesn't seem the correct abstraction to use.

@Override
public boolean synchronizedHandleRequest(VaadinSession session,
VaadinRequest request, VaadinResponse response) throws IOException {
handleTranslationRequest(session.getService(), request, response);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be request.getService() instead to be clear that the session is not needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll fix that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mcollovati mcollovati requested a review from Artur- January 19, 2026 12:35
Artur-
Artur- previously approved these changes Jan 19, 2026
@Override
public boolean handleSessionExpired(VaadinRequest request,
VaadinResponse response) throws IOException {
if (!canHandleRequest(request)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Somehow this looks inverted to me when it could be "if we can handle, handle it, otherwise don't"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update

Implement SessionExpiredHandler in TranslationFileRequestHandler to
serve translations even when no active session exists. This allows
i18n requests to work correctly with stateless authentication.

Fixes #23238
@mcollovati mcollovati force-pushed the issues/23238-TranslationFileRequestHandler_sessionExpired branch from dedacc9 to 8c1382e Compare January 19, 2026 13:21
@sonarqubecloud
Copy link

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

Labels

target/24.9 target/25.0 Cherry-pick to 25.0 branch +0.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n requests often fail with stateless authenticaction

3 participants