User onboarding registration type is converted from free to invite

Summary

User onboarding registration type is converted from free to invite when a group is created during sign-up.

Steps to reproduce

  • Start sign up process.
  • On welcome page select create group.
  • Create a group and finish registration

What is the current bug behavior?

On UserDetail's onboarding status free registration type is converted to invite:

 onboarding_status: {"step_url"=>"/users/sign_up/groups/new", "email_opt_in"=>false, "registration_type"=>"invite", "initial_registration_type"=>"free"},

What is the expected correct behavior?

Registration type remains free.

Possible fixes

We can guard https://gitlab.com/gitlab-org/gitlab/-/blob/8a867dc3c4e5b0ae5b8d39ae5bff72e56985fe9d/ee/app/services/ee/members/creator_service.rb#L47 by checking last_owner? before converting for a single member newly created group.