-
Notifications
You must be signed in to change notification settings - Fork 452
fix(api): provision defaults for invited teams #2922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperdx/api': patch | ||
| --- | ||
|
|
||
| Apply configured default connections and sources when a user accepts a team invite. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,6 +168,15 @@ router.post('/team/setup/:token', async (req, res, next) => { | |
| ); | ||
| } | ||
|
|
||
| try { | ||
| await setupTeamDefaults(teamInvite.teamId.toString()); | ||
| } catch (error) { | ||
| logger.error( | ||
| { err: serializeError(error) }, | ||
| 'Failed to setup team defaults', | ||
| ); | ||
|
Comment on lines
+171
to
+177
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The added team-scoped provisioning call and its countable failure log attach neither business context nor a metric, preventing failures from being reliably attributed and counted by team during incident diagnosis. Context Used: AGENTS.md (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| } | ||
|
|
||
| await TeamInvite.findByIdAndRemove(teamInvite._id); | ||
|
|
||
| req.login(user, err => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the invited team is not the first team returned by MongoDB, this call reaches
getTeam(teamId), which ignores the supplied ID, causing default connections and sources to be assigned to another tenant while the invited team remains unprovisioned.Knowledge Base Used: