Skip to content

fix: align funnel metrics with analytics and prevent duplicate orgs#773

Merged
bokelley merged 2 commits into
mainfrom
bokelley/dashboard-funnel-fix
Jan 15, 2026
Merged

fix: align funnel metrics with analytics and prevent duplicate orgs#773
bokelley merged 2 commits into
mainfrom
bokelley/dashboard-funnel-fix

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Funnel/Analytics consistency: Dashboard funnel now uses MEMBER_FILTER instead of deprecated org_lifecycle_stage field, ensuring member counts match the analytics table
  • Simplified org tier filters: HAS_USER and HAS_ENGAGED_USER filters now use organization_domains for Slack user email matching and last_slack_activity_at for activity detection (removes reliance on never-populated pending_organization_id and empty slack_activity_daily table)
  • Duplicate prevention: Added 409 Conflict checks to create-prospect endpoints and user org creation to prevent duplicate organizations when a domain is already claimed
  • Performance: Added index on last_slack_activity_at for the HAS_ENGAGED_USER filter

Test plan

  • Verified funnel and analytics both show consistent member counts
  • Tested with Vibium browser automation
  • Build passes with all tests green

🤖 Generated with Claude Code

bokelley and others added 2 commits January 14, 2026 20:45
- Update dashboard funnel to use MEMBER_FILTER instead of deprecated
  org_lifecycle_stage field for consistent member counts
- Simplify HAS_USER and HAS_ENGAGED_USER filters to use organization_domains
  for Slack user matching (removes reliance on pending_organization_id and
  slack_activity_daily table)
- Add 409 Conflict checks to create-prospect endpoints to prevent duplicate
  organizations when domain is already claimed
- Add duplicate domain check before user org creation
- Add index on last_slack_activity_at for query performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migration 169 already exists on main (remove_rss_from_editorial).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 4bd70c4 into main Jan 15, 2026
6 checks passed
bokelley added a commit that referenced this pull request Jan 16, 2026
…773)

* fix: align funnel metrics with analytics and prevent duplicate orgs

- Update dashboard funnel to use MEMBER_FILTER instead of deprecated
  org_lifecycle_stage field for consistent member counts
- Simplify HAS_USER and HAS_ENGAGED_USER filters to use organization_domains
  for Slack user matching (removes reliance on pending_organization_id and
  slack_activity_daily table)
- Add 409 Conflict checks to create-prospect endpoints to prevent duplicate
  organizations when domain is already claimed
- Add duplicate domain check before user org creation
- Add index on last_slack_activity_at for query performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: rename migration to 170 to avoid version conflict

Migration 169 already exists on main (remove_rss_from_editorial).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Jan 20, 2026
…773)

* fix: align funnel metrics with analytics and prevent duplicate orgs

- Update dashboard funnel to use MEMBER_FILTER instead of deprecated
  org_lifecycle_stage field for consistent member counts
- Simplify HAS_USER and HAS_ENGAGED_USER filters to use organization_domains
  for Slack user matching (removes reliance on pending_organization_id and
  slack_activity_daily table)
- Add 409 Conflict checks to create-prospect endpoints to prevent duplicate
  organizations when domain is already claimed
- Add duplicate domain check before user org creation
- Add index on last_slack_activity_at for query performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: rename migration to 170 to avoid version conflict

Migration 169 already exists on main (remove_rss_from_editorial).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant