posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix: closed some holes in 'enterprise' plan detection

Open slshults opened this issue 7 months ago â€ĸ 3 comments

Problem

Fixing Enterprise plan detection

  • A ticket from one of our biggest enterprise customers wasn't tagged with plan_enterprise as it should have been.

  • We saw a ticket which seemed to have cached value for the plan tag, and sent that value again the following day instead of the correct value (after we merged a bug fix)

Changes

  • Enhanced Enterprise detection - Added comprehensive logic to catch special / legacy Enterprise configs
  • org-specific fallback - Added a list where we can add specific org IDs to make sure we don't show the wrong plan for important enterprise customers. (There's only one org in the list in this PR.) We can potentially duplicate this for plan_top20 fallbacks later if needed.
  • Fixed Cancel button - Now properly clears form fields when clicked
  • Added billing refresh - Opening the support form now gets it fresh billing data, to prevent caching issues
  • Decluttered comments 🤖

How did you test this code?

On my local, by temporarily commenting out the onboarding logic, changing my billing level to different trials and plans, and temporarily adding my local's org_id to the org-specific fallback list.

slshults avatar Jun 13 '25 19:06 slshults

Size Change: -171 B (-0.01%)

Total Size: 2.57 MB

â„šī¸ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 2.57 MB -171 B (-0.01%)

compressed-size-action

github-actions[bot] avatar Jun 13 '25 19:06 github-actions[bot]

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Jun 13 '25 23:06 posthog-bot

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

[!CAUTION]

Detected flapping snapshots

These snapshots have auto-updated more than once since the last human commit:

  • scenes-app-insights-funnels--funnel-top-to-bottom-breakdown--dark.png (chromium, shard 2)

The flippy-flappies are deadly and must be fixed ASAP. They're productivity killers. Run pnpm storybook locally and make the fix now. (Often, the cause is ResizeObserver being used instead of the better CSS container queries.)

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Jun 13 '25 23:06 posthog-bot

+1 this client side logic is getting confusing, we should just use the response from billing because it should solve this.

zlwaterfield avatar Jun 16 '25 15:06 zlwaterfield

Aha, thanks much, makes sense! Will work on those changes tomorrow...

slshults avatar Jun 16 '25 15:06 slshults

Couple of minor issues - approving in advance.

One additional idea for future improvements (not in the scope of this PR) - we surface accountOwner info in billingLogic - we could add this so that we know who's the AE/CSM on a ticket - unless you already have this info from somewhere else?

Ooo, nice idea! We're getting it via 3rd party APIs and webhooks, but this idea would be much more dependable. Will add next week.

Thanks for the reviews @pawel-cebula and @zlwaterfield !

slshults avatar Jun 19 '25 00:06 slshults