Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Fix issue in SAMS account disambiguation#62738

Merged
chrsmith merged 2 commits into
mainfrom
chrsmith/support-trialing-subs-in-sams-disambiguation
May 16, 2024
Merged

Fix issue in SAMS account disambiguation#62738
chrsmith merged 2 commits into
mainfrom
chrsmith/support-trialing-subs-in-sams-disambiguation

Conversation

@chrsmith

Copy link
Copy Markdown
Contributor

There was a minor error in the the logic we use to disambiguate fetching the Cody Pro subscription for a Sourcegraph user with multiple SAMS identities.

The SSC backend assigns a Cody Pro subscription to a SAMS user account. However, a single Sourcegraph.com user account can have multiple SAMS identities. This leads to problems...

So as a workaround until we can fix https://github.com/sourcegraph/sourcegraph/issues/60912 more generally (e.g. remove all instances where a dotcom user has multiple SAMS accounts), we have some logic to "pick the right Cody Pro subscription". (e.g. if a user has 2x canceled Cody Pro subscriptions, but one that is active. Select the active one.)

The problem we have in the code is that we should consider the subscription status of trialing as being one of the good ones. (In addition to active and past_due.) If a user is on a free trial of the product, they will have access to Cody Pro. So we should "pick that one" instead of falling back to whatever Cody Pro subscription is tied to the user's "first" SAMS account.

Test plan

Relying on CI/CD.

@chrsmith chrsmith requested review from a team, 0xnmn and unknwon May 16, 2024 17:59
@cla-bot cla-bot Bot added the cla-signed label May 16, 2024
@chrsmith chrsmith enabled auto-merge (squash) May 16, 2024 18:44
@chrsmith chrsmith merged commit 1735843 into main May 16, 2024
@chrsmith chrsmith deleted the chrsmith/support-trialing-subs-in-sams-disambiguation branch May 16, 2024 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix/remove merging subscription info from multiple SAMS accounts for a dotcom user

2 participants