Skip to content

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

mbani01
Copy link
Contributor

@mbani01 mbani01 commented Jun 12, 2025

Changes proposed ✍️

Use segmentId instead of tenantId to get LinkedIn tokens from nango

What

copilot:summary

copilot:poem

Why

How

copilot:walkthrough

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@mbani01 mbani01 self-assigned this Jun 12, 2025
@mbani01 mbani01 added Bug Created by Linear-GitHub Sync Support 🛟 Created by Linear-GitHub Sync labels Jun 12, 2025
@mbani01 mbani01 marked this pull request as draft June 12, 2025 14:44
Copy link
Contributor Author

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

@mbani01 mbani01 marked this pull request as ready for review June 12, 2025 15:39
@mbani01 mbani01 marked this pull request as draft June 13, 2025 10:51
@mbani01 mbani01 marked this pull request as ready for review June 16, 2025 17:49
@@ -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'
Copy link
Contributor

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}`
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor Author

@mbani01 mbani01 Jun 17, 2025

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

@mbani01 mbani01 force-pushed the fix/linkedin_connect branch from d73243c to 5a1b8e9 Compare June 17, 2025 11:45
@mbani01 mbani01 force-pushed the fix/linkedin_connect branch from 5a1b8e9 to 32d3d14 Compare June 17, 2025 11:54
@mbani01 mbani01 merged commit 2a5deb3 into main Jun 18, 2025
11 checks passed
@mbani01 mbani01 deleted the fix/linkedin_connect branch June 18, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Created by Linear-GitHub Sync Support 🛟 Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants