Skip to content

[Analytics] Include Invite ID with Team created Call #8949

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

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

jakobhero
Copy link
Contributor

@jakobhero jakobhero commented Mar 24, 2022

Description

Generates and includes an invitation ID with each team created Segment call. This is done in order to have an ID available in downstream tools after a team was created so that it can be sent to users outside of the product.

How to test

  1. Open a preview environment, sign up and create a team
  2. Go to the debugger of Staging Untrusted
    and ensure that the team_created call includes an invite_id

Release Notes

NONE

Documentation

/werft analytics=segment|TEZnsG4QbLSxLfHfNieLYGF4cDwyFWoe

@jakobhero
Copy link
Contributor Author

/werft run

@jakobhero jakobhero force-pushed the jh/team_invite_call branch from 682a8bf to db8d56c Compare March 24, 2022 17:36
@jakobhero jakobhero changed the title [Analytics] Include Invite URL with Team created Call [Analytics] Include Invite ID with Team created Call Mar 24, 2022
@jakobhero
Copy link
Contributor Author

jakobhero commented Mar 24, 2022

/werft run

👍 started the job as gitpod-build-jh-team-invite-call.2

@jakobhero jakobhero marked this pull request as ready for review March 24, 2022 17:57
@jakobhero jakobhero requested a review from a team March 24, 2022 17:57
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 24, 2022
Copy link
Member

@easyCZ easyCZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible, just a question to clarify my understanding.

@@ -1974,6 +1974,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
// Note: this operation is per-user only, hence needs no resource guard
const user = this.checkAndBlockUser("createTeam");
const team = await this.teamDB.createTeam(user.id, name);
const invite = await this.getGenericInvite(ctx, team.id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retrieval of the genericInvite seems to also reset the invite link. Is this potentially a problem if the invite has already been sent? I'm not intimately familiar with the product/code behaviour in this area so seeking clarification.

public async resetGenericInvite(ctx: TraceContext, teamId: string): Promise<TeamMembershipInvite> {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @easyCZ , thanks for having a look! i went back into the preview environment and checked, the invite URL attached to the team created call here does not change unless the reset invite button is clicked below (at which point any previously sent invites lose their validity). thus, using this.getGenericInvite() is fine here imo as:

  • no invites to a team can be sent prior to its creation
  • the behaviour after this call is consistent with what's happening now as the invite URL remains the same unless it's manually reset

Screenshot 2022-03-28 at 10 54 34

@jakobhero
Copy link
Contributor Author

jakobhero commented Mar 28, 2022

/werft run

👍 started the job as gitpod-build-jh-team-invite-call.3

@roboquat roboquat merged commit dd2f9d5 into main Mar 28, 2022
@roboquat roboquat deleted the jh/team_invite_call branch March 28, 2022 12:14
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants