Fix status mapping evaluation for non-persisted current status records
What does this MR do and why?
When a work item doesn't have a current status record (all work items created before the MVC1 release of configurable statuses in %18.2), they fall back to lifecycle's default status through a non-persisted CurrentStatus
record using the status_with_fallback method.
This caused ArgumentError when find_mapped_status tried to compare nil
updated_at
with mapping's valid_until
timestamp.
This MR sets updated_at
to work item's created_at
when building fallback current status records to support time-constrained status mapping evaluations.
This is consistent with existing filtering logic that compares mapping timestamps to issues.created_at
.
Notes
- The issue started occurring in %18.6, after the deployment of !208414 (merged).
- This bug only affects the feature in %18.6, so no backports are required.
References
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Create a new group, project, and two issues.
- Delete the current status record from the last issue via the Rails console:
WorkItem.last.current_status.delete
. - In the issues settings page (
/groups/group-23-10/-/settings/issues
), create a new status calledNew default
. - Delete the existing
To do
status, map it toNew default
, and setNew default
as the default open status. - Re-add the
To do
status and make it the default again. - Navigate to the group or project work items list.
- Before the fix: Expect to see the 'Something went wrong' error when fetching work items.
- After the fix: The work item list and drawer should load without issues.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.