Skip to content

Apply default connections and sources when accepting a team invite #2921

Closed

Description

@mfroembgen

Problem

DEFAULT_CONNECTIONS and DEFAULT_SOURCES are applied when password registration creates a new team, but not when the first user accepts an invite to an already-created empty team.

That leaves the invited team without its configured default connection and sources. Deployments that bootstrap a team and invite before the first user joins must either mutate MongoDB directly or leave source setup to a user.

Expected behavior

After invite-based user registration succeeds, call setupTeamDefaults(teamInvite.teamId) with the same non-fatal error handling used by password registration.

The existing helper already preserves configured teams by skipping connection or source creation when those objects exist.

Reproduction

  1. Configure DEFAULT_CONNECTIONS and DEFAULT_SOURCES.
  2. Create an empty team and a valid invite for it.
  3. Accept the invite through POST /team/setup/:token.
  4. Observe that the user is created, but the configured connection and sources are not.

Suggested coverage

  • An invited empty team receives its configured defaults.
  • An invited team with existing sources is not overwritten.
  • Default provisioning failure does not prevent the user from joining.

Activity

  1. Vansh98789 commented on Aug 17, 2026

    @Vansh98789
    Contributor

    Hi @mfroembgen, is the issue still open?

  2. wrn14897 commented on Aug 18, 2026

    @wrn14897
    Contributor

    @mfroembgen, can you elaborate on the issue here? Especially what you mean by “but not when the first user accepts an invite to an already-created empty team”?

  3. mfroembgen commented on Sep 3, 2026

    @mfroembgen
    ContributorAuthor

    @Vansh98789 @wrn14897 Yes, this issue is still open. PR #2922 contains the fix.
    The problem occurs when a team and a team invite exist before the first user account exists. The first user accepts the team invite. The API creates the user and adds the user to the team.
    Before this fix, the API did not create the configured default connections and sources for that team. Normal password registration already performs this setup.
    PR #2922 makes team invite acceptance perform the same setup. It also makes sure that the API uses the invited team ID.

  4. mfroembgen commented on Sep 3, 2026

    @mfroembgen
    ContributorAuthor

    But when we stick with the initial registration flow, then its actually not an issue. Therefore let me close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions