-
Notifications
You must be signed in to change notification settings - Fork 9.3k
fix: stripe integration in EventTypeSettings
atom
#20919
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?
fix: stripe integration in EventTypeSettings
atom
#20919
Conversation
@@ -299,7 +299,7 @@ export class EventTypesAtomService { | |||
userCredentialIds, | |||
invalidCredentialIds, | |||
teams, | |||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal, | |||
isInstalled: (!!userCredentialIds.length || !!teams.length || app.isGlobal) ?? app.installed, |
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.
turns out for an individual user sometimes no user credentials or app.isGlobal property is present (which is weird) which results in isInstalled
property set to undefined which we don't want, hence we should fallback to app.installed
which is a depreceated property but should work for now
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.
this will never happen for team events since there will always be a team length present if its a team event
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
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.
mrge found 2 issues across 1 file. View them in mrge.io
@@ -299,7 +299,7 @@ export class EventTypesAtomService { | |||
userCredentialIds, | |||
invalidCredentialIds, | |||
teams, | |||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal, | |||
isInstalled: (!!userCredentialIds.length || !!teams.length || app.isGlobal) ?? app.installed, |
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.
Consider using a logical OR (||) instead of nullish coalescing operator (??), as it better matches the intent of providing a fallback when the left side is falsy.
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.
I was just thinking of this
@@ -299,7 +299,7 @@ | |||
userCredentialIds, | |||
invalidCredentialIds, | |||
teams, | |||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal, | |||
isInstalled: (!!userCredentialIds.length || !!teams.length || app.isGlobal) ?? app.installed, |
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.
Rule violated: Enforce Singular Naming for Single-Item Functions
Function name 'getEventTypesAppIntegration' uses plural form but returns a single item
Graphite Automations"Add platform team as reviewer" took an action on this PR • (04/23/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (04/24/25)1 label was added to this PR based on Keith Williams's automation. |
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.
mrge reviewed 1 file and found no issues. Review this PR in mrge.io.
@@ -299,7 +299,7 @@ export class EventTypesAtomService { | |||
userCredentialIds, | |||
invalidCredentialIds, | |||
teams, | |||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal, | |||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal || app.installed, |
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.
not sure to understand teams.length check in this but it's not related to this pr, we might want to add comments if this keep getting more and more complicated
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.
the logic was referenced from getConnectedApps.ts
which we use in the webapp, but after debugging a bit more found out the issue lies somewhere hence turned this PR into draft
E2E results are ready! |
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.
mrge found 3 issues across 1 file. View them in mrge.io
// We only add delegationCredentials if the request for location options is for a user because DelegationCredential Credential is applicable to Users only. | ||
const { credentials: allCredentials } = await enrichUserWithDelegationConferencingCredentialsWithoutOrgId( | ||
|
||
const enabledApps = await getEnabledAppsFromCredentials( |
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.
Type assertion from credentials to CredentialDataWithTeamName[] is a code smell that suggests a type mismatch. Consider fixing the types properly.
@@ -226,20 +226,26 @@ export class EventTypesAtomService { | |||
} else { | |||
credentials = credentials.concat(teamAppCredentials); | |||
} | |||
} else { |
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.
Missing rationale for special treatment of Stripe integration in comments
@@ -226,20 +226,26 @@ export class EventTypesAtomService { | |||
} else { | |||
credentials = credentials.concat(teamAppCredentials); | |||
} | |||
} else { | |||
if (slug !== "stripe") { |
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.
Consider inverting the condition to return early and reduce nesting
What does this PR do?
Image Demo:
Before

After

Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This can be tested in the examples app