User select sometimes does not provide user name

Discussion

The following discussion from !182767 (merged) should be addressed:

Potential fix/analysis

  1. Adding a test for user_select causes a pipeline job to fail
Error
Summary of all failing tests
 FAIL  ee/spec/frontend_integration/security_orchestration/policy_editor/pipeline_execution/skip_ci_configuration_spec.js
  ● Test suite failed to run
    Unhandled Promise rejections: Error: Caught error after test environment was torn down
    [vue-test-utils]: find did not return [data-testid="rule-editor-preview-content"], cannot call text() on empty Wrapper
      at tearDownEnv (node_modules/jest-runner/build/runTest.js:286:7)
 FAIL  spec/frontend_integration/content_editor/content_editor_integration_spec.js
  ● content_editor › when loading initial content › when the initial content is empty › still hides the loading indicator
    TypeError: Cannot read properties of undefined (reading 'name')
      20 |
      21 | export default {
    > 22 |   components: {
         |                ^
      23 |     GlAvatarLabeled,
      24 |     GlCollapsibleListbox,
      25 |   },
      at createUserObject (ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:22:16)
      at ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:76:18
          at Array.map (<anonymous>)
      at VueComponent.update (ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:73:37)
      at SmartQuery.nextResult (node_modules/vue-apollo/dist/vue-apollo.umd.js:991:46)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:135:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.next (node_modules/zen-observable/lib/Observable.js:235:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:4:68
          at Array.forEach (<anonymous>)
      at Object.iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:4:25)
      at ObservableQuery.iterateObserversSafely [as reportResult] (node_modules/@apollo/client/core/ObservableQuery.js:400:13)
      at Object.next (node_modules/@apollo/client/core/ObservableQuery.js:375:23)
      at node_modules/@apollo/client/utilities/observables/iteration.js:4:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:4:25)
      at Object.next (node_modules/@apollo/client/utilities/observables/Concast.js:25:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:135:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.next (node_modules/zen-observable/lib/Observable.js:235:7)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:19:38
  ● content_editor › when loading initial content › when the initial content is empty › still hides the loading indicator
    expect.hasAssertions()
    Expected at least one assertion to be called but received none.
      71 |   // see https://jestjs.io/docs/en/expect#expecthasassertions
      72 |   // eslint-disable-next-line jest/no-standalone-expect
    > 73 |   expect.hasAssertions();
         |          ^
      74 |
      75 |   // Reset globals: This ensures tests don't interfere with
      76 |   // each other, and removes the need to tidy up if it was
      at Object.hasAssertions (spec/frontend/__helpers__/shared_test_setup.js:73:10)
  ● content_editor › when loading initial content › when the initial content is not empty › hides the loading indicator
    TypeError: Cannot read properties of undefined (reading 'name')
      20 |
      21 | export default {
    > 22 |   components: {
         |                ^
      23 |     GlAvatarLabeled,
      24 |     GlCollapsibleListbox,
      25 |   },
      at createUserObject (ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:22:16)
      at ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:76:18
          at Array.map (<anonymous>)
      at VueComponent.update (ee/app/assets/javascripts/security_orchestration/components/shared/user_select.vue:73:37)
      at SmartQuery.nextResult (node_modules/vue-apollo/dist/vue-apollo.umd.js:991:46)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:135:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.next (node_modules/zen-observable/lib/Observable.js:235:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:4:68
          at Array.forEach (<anonymous>)
      at Object.iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:4:25)
      at ObservableQuery.iterateObserversSafely [as reportResult] (node_modules/@apollo/client/core/ObservableQuery.js:400:13)
      at Object.next (node_modules/@apollo/client/core/ObservableQuery.js:375:23)
      at node_modules/@apollo/client/utilities/observables/iteration.js:4:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:4:25)
      at Object.next (node_modules/@apollo/client/utilities/observables/Concast.js:25:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:135:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.next (node_modules/zen-observable/lib/Observable.js:235:7)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:19:38
Test Suites: 2 failed, 37 passed, 39 total
Tests:       2 failed, 212 passed, 214 total
Snapshots:   4 passed, 4 total
Time:        169.078 s
Ran all test suites.
  1. In Slack (private), we are seeing a similar sentry error
APP  12:44 AM
:red_circle: TypeError

Cannot read properties of null (reading 'name')

environment: gprd  transaction: /groups/group-1/-/security/policies/Enforce+Security+Scanner/edit
State: New   First Seen: Just now

They could be related, but more investigation is needed

Edited by Alexander Turinske