jakartaee / jakartaee/faces

Cleanup for unused Flows

Open
#1,398 4 comments 0 reactions 0 assignees View on GitHub
Component: Flow Priority: Major Type: Improvement
Dominant language
Java
Stars
127
Forks
59
Avg merge
23h
Merged PRs (30d)
7

Description

One thing missing from the faces flow spec that exists with @ConversationScoped are access timeouts after which the current scope is invalidated and destroyed.

Consider the case where a flow is not exited through the flow return, but instead simply abandoned by the user (via the back button, bookmarks or after closing a window). In this case the flow scoped beans will stay in the session, until the session is destroyed. In a web application with flows that is used intensively by its users for a long time it's easily possible that 100s of flow instances stay in the session before they are cleaned up and thus wasting a lot of memory.

To solve this problem either

* a timeout could be introduced - similar to Conversations. This timeout could be specified for all flow as a web context param or on a flow level in the flow definition.
* or alternatively a maximum of client window instances per flow could be set globally (implemented like ViewMaps by a LRU Map).
#### Affected Versions
[2.2, 2.3]

Contributor guide

Open the contributing guide

Research direction

Start with the Faces flow specification and the lifecycle of @ConversationScoped beans, then compare the existing conversation timeout and ViewMaps behavior mentioned in the issue. Decide whether cleanup should use a configurable timeout or a per-flow client-window limit, and define completion as abandoned flow-scoped beans being removed without waiting for session destruction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.