Skip to content

Update quarkus-http, create test coverage for Undertow session context events #48083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

manovotn
Copy link
Contributor

The idea is to enable @SessionScoped beans to observe its own @Initialized and @BeforeDestroyed events (which they should be able to according to the specification).

The fix itself is in quarkus-http, see quarkusio/quarkus-http#174

Fixes #46363

@manovotn manovotn requested review from Ladicek and mkouba May 27, 2025 11:26
@manovotn manovotn added area/arc Issue related to ARC (dependency injection) area/undertow labels May 27, 2025
@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label May 27, 2025
Copy link

quarkus-bot bot commented May 27, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit d188f5c.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Contributor

@Ladicek Ladicek left a comment

Choose a reason for hiding this comment

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

LGTM, just wondering if we maybe wanna assert that session-scoped beans cannot observe @Destroyed(SessionScoped.class)?

@mkouba
Copy link
Contributor

mkouba commented May 27, 2025

LGTM, just wondering if we maybe wanna assert that session-scoped beans cannot observe @Destroyed(SessionScoped.class)?

Except that it's not exactly defined what happens if an observer method is invoked and the relevant context is not active 🤔...

@Ladicek
Copy link
Contributor

Ladicek commented May 27, 2025

Except that it's not exactly defined what happens if an observer method is invoked and the relevant context is not active 🤔...

You mean when the event is fired? I'm thinking the observer method should not be called at all. But if it's more complex than what I imagine, then let's leave it :-)

@manovotn
Copy link
Contributor Author

LGTM, just wondering if we maybe wanna assert that session-scoped beans cannot observe @Destroyed(SessionScoped.class)?

I am not sure we test this for any other scope but TBF it doesn't make sense to me - we always deactivate context and then fire the event. And that is the only sensible order of actions to me so I see such test as completely redundant...but maybe I am missing something 🤷

You mean when the event is fired? I'm thinking the observer method should not be called at all.

I agree, and that is what Weld does too.

@mkouba
Copy link
Contributor

mkouba commented May 27, 2025

LGTM, just wondering if we maybe wanna assert that session-scoped beans cannot observe @Destroyed(SessionScoped.class)?

I am not sure we test this for any other scope but TBF it doesn't make sense to me - we always deactivate context and then fire the event. And that is the only sensible order of actions to me so I see such test as completely redundant...but maybe I am missing something 🤷

You mean when the event is fired? I'm thinking the observer method should not be called at all.

I agree, and that is what Weld does too.

And ArC does the same since 3.0.0.Final.

@manovotn
Copy link
Contributor Author

@mkouba do you then agree to keep this PR as is or should I change something?
I am not sure how to interpret your comment :)

@mkouba
Copy link
Contributor

mkouba commented May 27, 2025

@mkouba do you then agree to keep this PR as is or should I change something? I am not sure how to interpret your comment :)

I do agree.

@manovotn manovotn merged commit 0f07ec9 into quarkusio:main May 27, 2025
22 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.24 - main milestone May 27, 2025
@manovotn manovotn deleted the undertowSessionContextFix_secondAttempt branch May 27, 2025 14:51
@gsmet gsmet modified the milestones: 3.24 - main, 3.23.1 Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/dependencies Pull requests that update a dependency file area/undertow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undertow - Session context lifecycle events should be observable from session scoped beans
4 participants