Stop writing undefined time estimates into the board list cache

What does this MR do and why?

Opening a card on an issue board logs Missing field 'humanTimeEstimate' while writing result in the browser console. Nine board feature specs show it, and every board in production does too.

How it happens:

  • board_content.vue listens to work-item-updated from the drawer and maps the work item widgets onto the cached board issue with mapWorkItemWidgetsToIssuableFields.
  • The board issue fragment selected humanTimeEstimate and humanTotalTimeSpent. Nothing in the boards code reads them; cards render timeEstimate.
  • Commit 3b47290e moved time tracking out of the work item detail widgets fragment. The detail query still selects the widget type, so the mapper found a TIME_TRACKING widget with no fields and wrote undefined into the cache. Apollo logs a missing field for every undefined write.

What changes:

  • Commit 1 removes humanTimeEstimate and humanTotalTimeSpent from the board issue fragment, the optimistic responses in app/assets/javascripts/boards/constants.js and ee/app/assets/javascripts/boards/constants.js, and the Jest mock data.
  • Commit 2 makes the mapper return early when a widget carries no value for the mapped field. The list keeps the value it already has. This also prevents a TypeError in the assignees and labels branch when the widget has no nodes, which happens when the workItemFeaturesField feature flag skips the inline widget fragments.
  • New Jest examples in spec/frontend/work_items/list/utils_spec.js cover both behaviours and the board list shape.

References

Screenshots or screen recordings

The board looks the same before and after. This fix only removes a console error that appears when the drawer updates a card.

Both screenshots come from the same temporary feature spec: open a project issue board, click a card, add the Bug label in the drawer, and close the drawer. In both, the card receives the Bug label and appears in the Bug list.

Before (463bd8e9) After (b73e76d5)
before after

Browser console during the same run

Run Missing field 'humanTimeEstimate' while writing result
Before (463bd8e9) 4 times
After (b73e76d5) 0 times

Both runs showed only unrelated network failures (net::ERR_CONNECTION_RESET and net::ERR_CONNECTION_REFUSED from gravatar and snowplow), which are normal in the test environment.

How to set up and validate locally

  1. Open a project issue board in GDK with the browser console open.
  2. Click a card to open the drawer.
  3. On master, the console shows Missing field 'humanTimeEstimate' while writing result.
  4. On this branch, the error does not appear.
  5. Edit a label or the weight in the drawer and confirm the card updates.
  6. Run yarn jest spec/frontend/work_items/list/utils_spec.js spec/frontend/boards.

MR acceptance checklist

This MR was evaluated against the acceptance checklist.

Edited by Miguel Rincon

Merge request reports

Loading
Loading