Skip to content

fix(api): provision defaults for invited teams - #2922

Draft
mfroembgen wants to merge 1 commit into
hyperdxio:mainfrom
mfroembgen:codex/2921-invite-defaults
Draft

fix(api): provision defaults for invited teams#2922
mfroembgen wants to merge 1 commit into
hyperdxio:mainfrom
mfroembgen:codex/2921-invite-defaults

Conversation

@mfroembgen

Copy link
Copy Markdown
Contributor

Summary

  • apply configured default connections and sources when a user accepts a team invite
  • keep default provisioning non-blocking, matching password registration

How to test on Vercel preview

N/A — non-UI change

Testing

  • make dev-int FILE=team
  • make ci-lint
  • make ci-unit

References

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9d9b564

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

@mfroembgen is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR provisions configured default connections and sources when an invited user joins a team, while keeping provisioning failures non-blocking.

  • Corrects getTeam so it resolves the requested team rather than an arbitrary team.
  • Runs default provisioning with the invited team’s ID and records team/user context plus operation metrics.
  • Adds integration coverage for team lookup and invited-team provisioning.
  • Adds an API patch changeset.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/api/src/controllers/team.ts Changes team retrieval to honor the supplied ID, resolving the previously reported cross-team provisioning defect.
packages/api/src/routers/api/root.ts Provisions defaults for the invited team with request business context, operation metrics, and non-blocking error handling.
packages/api/src/controllers/tests/team.int.test.ts Verifies that getTeam returns the specifically requested team when multiple teams exist.
packages/api/src/routers/api/tests/team.int.test.ts Verifies invite acceptance invokes default provisioning with the invited team’s ID.
.changeset/tidy-invites-share.md Records the invited-team default provisioning behavior as an API patch release.

Sequence Diagram

sequenceDiagram
    participant U as Invited user
    participant API as Team setup route
    participant DB as MongoDB
    participant P as Default provisioner
    U->>API: Submit invite token and password
    API->>DB: Resolve invitation and create user
    API->>API: Attach team/user business context
    API->>P: setupTeamDefaults(invitedTeamId)
    P->>DB: Resolve invited team by ID
    P->>DB: Create configured connections and sources
    alt Provisioning fails
        P-->>API: Throw error
        API->>API: Record failure metric and log error
    end
    API->>DB: Remove invitation
    API-->>U: Start session and redirect
Loading

Reviews (2): Last reviewed commit: "fix(api): provision defaults for invited..." | Re-trigger Greptile

Comment thread packages/api/src/routers/api/root.ts Outdated
Comment thread packages/api/src/routers/api/root.ts
@mfroembgen
mfroembgen force-pushed the codex/2921-invite-defaults branch from 4ec0a23 to 9d9b564 Compare August 25, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply default connections and sources when accepting a team invite

1 participant