Skip to content

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

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

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-botBot 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
NameType
@hyperdx/apiPatch
@hyperdx/appPatch
@hyperdx/otel-collectorPatch

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

vercelBot 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-appsBot 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

FilenameOverview
packages/api/src/controllers/team.tsChanges team retrieval to honor the supplied ID, resolving the previously reported cross-team provisioning defect.
packages/api/src/routers/api/root.tsProvisions defaults for the invited team with request business context, operation metrics, and non-blocking error handling.
packages/api/src/controllers/tests/team.int.test.tsVerifies that getTeam returns the specifically requested team when multiple teams exist.
packages/api/src/routers/api/tests/team.int.test.tsVerifies invite acceptance invokes default provisioning with the invited team’s ID.
.changeset/tidy-invites-share.mdRecords 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 threadpackages/api/src/routers/api/root.ts Outdated
Comment threadpackages/api/src/routers/api/root.ts
Sign up for freeto 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

@mfroembgen