-
Notifications
You must be signed in to change notification settings - Fork 740
fix: use segmentId instead of tenantId to get linkedIn tokens from nango [CM-335] #3173
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
Conversation
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.
Although the PR shows many changes, the only actual modification is on line 6 (unused variables), which slipped through without lint validation. All other changes are just noise from outdated commit history — no functional edits were made
@@ -3,7 +3,6 @@ import CronTime from 'cron-time-generator' | |||
import { IS_PROD_ENV, distinct } from '@crowd/common' | |||
import { Logger } from '@crowd/logging' | |||
import { KafkaAdmin, QUEUE_CONFIG, getKafkaClient } from '@crowd/queue' |
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 think you can just merge main to fix this file.
const nangoId = | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
(runInfo.integrationSettings as any)?.nangoId || | ||
`${DEFAULT_TENANT_ID}-${runInfo.integrationType}` |
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.
Isn't it broken to use tenantId
now?
So to explain:
- when crowd.dev repo was still under crowd.dev company we had multiple customers (tenants) and each could connect only one integration per platform so for example only 1 linkedin integration could be connected
- but now we don't have multiple tenants (there are still tenants but it's basically deprecated feature - only have one row in tenants db table) but we can have multiple linkedins for this same default tenant id - but only one per segment (project)
so I would hard deprecate this nango id with default tenant id as it doesn't make sense at all even for legacy connections.
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.
Are existing nango connection ids gonna be updated manually or with a migration?
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 agree, I kept the default value just to avoid hiccups before updating db, because now we have a mix between segmentId (for new LinkedIn connections) and tenantId for other integrations.
But yes in any ways we shouldn't have any tenantId after the fix. I'll remove it.
Since we have less than 10 connections, I'll manually update them as it's a one time fix
d73243c
to
5a1b8e9
Compare
5a1b8e9
to
32d3d14
Compare
Changes proposed ✍️
Use
segmentId
instead oftenantId
to get LinkedIn tokens from nangoWhat
copilot:summary
copilot:poem
Why
How
copilot:walkthrough
Checklist ✅
Feature
,Improvement
, orBug
.