You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clean up scheduled workflow state when a client is removed - #55641
JpaWorkflowStateProviderFactory only listened for UserRemovedEvent and RealmRemovedEvent, so scheduled workflow steps for a removed client were never deleted from WORKFLOW_STATE.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Client cleanup can incorrectly delete a surviving user’s scheduled workflows when their IDs collide in the same realm, and the persisted-state regression is excluded from cross-database testing.
Closeskeycloak#55603
JpaWorkflowStateProviderFactory only listened for UserRemovedEvent and
RealmRemovedEvent, so scheduled workflow steps for a removed client
were never deleted from WORKFLOW_STATE.
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The resource-type equality check excludes legacy states with null RESOURCE_TYPE, leaving existing client and user executions orphaned unless those rows are backfilled or handled by a collision-safe fallback.
…s populated
Resource-type-scoped cleanup on user/client removal only matches rows whose
RESOURCE_TYPE is set, so rows scheduled before that column started being
populated would never match and stay orphaned after upgrade. Backfill derives
the type from each row's owning workflow's configured supported type; rows
whose workflow no longer exists are left as-is, since they were already
unreachable through the workflow's realm.
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A delete-client step with a delayed successor can recreate workflow state after the client is deleted, leaving orphaned scheduled state; advancement must stop when the resource is removed, with regression coverage for this case.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Prevent scheduling successors after client deletion
When a delete-client step has a delayed successor, this listener removes the current state during step execution, but RunWorkflowTask then schedules the successor in a separate transaction; scheduleStep recreates the row because it no longer exists. The deleted client therefore still ends up with orphaned scheduled state. Stop advancement when the resource has been removed (and add a delete-client-with-successor regression).
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
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.
Closes #55603
JpaWorkflowStateProviderFactory only listened for UserRemovedEvent and RealmRemovedEvent, so scheduled workflow steps for a removed client were never deleted from WORKFLOW_STATE.