Skip to content

fix: promote self-host isolation without changing hosted behavior - #826

Merged
izadoesdev merged 21 commits into
mainfrom
staging
Sep 18, 2026
Merged

izadoesdev merged 21 commits into
mainfrom
staging

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

Promote #825 from staging to preserve hosted behavior with SELFHOST unset or false. The changes restore hosted auth cookies and verification emails, alarm senders, registration, setup snippets/prompts, and CSP while retaining the self-host improvements behind SELFHOST=true. Boolean-only mode checks no longer initialize unrelated URL configuration.

#789 merged at 09:27 UTC on September 17, before #825 landed at 09:44 UTC. This follow-up contains only #825 (9cf89be0c982ab81f2688fcd0e90fcb8d93c9177) at creation. Independent init-image publishing (#824) is already included in #789.

Validation

  • Root lint, all 33 typecheck tasks, and all 29 test tasks pass.
  • Regression tests cover unset/false/true self-host settings. Chromium registration passes in both modes using synthetic responses.
  • Nine hosted snippet variants, the hosted setup prompt, and hosted security headers match their pre-self-host output exactly.
  • fix(dashboard): isolate self-host behavior from hosted deployments #825 final-head CI, CodeQL, browser tests, service health checks, self-host initialization, and preview builds passed. Greptile completed with 5/5; every review thread is resolved.

This draft prepares the production follow-up; it does not deploy or publish images. Recheck final promotion-head CI and review and obtain the required main-branch approval before merging. Existing hosted verification opt-out UI and setup examples are deliberately preserved; improvements to those are separate from self-host isolation.

AI-assisted implementation and review under the maintainer workflow.


Summary by cubic

Promotes self-host isolation while restoring hosted behavior when SELFHOST is unset or false: hosted deployments keep their prior auth cookies, verification emails, alarm senders, registration prompts, setup snippets, and CSP, and self-hosted deployments keep isolated behavior behind SELFHOST=true. Mode checks now use @databuddy/env/boolean so reading SELFHOST no longer initializes unrelated URL configuration.

Slack

  • Ignores mentions from other bots and deduplicates duplicate event deliveries across replicas.
  • Interactive API calls settle without retries or rate-limit blocking after the @slack/web-api 8.1.1 bump.
  • Streamed answers keep their tables and feedback blocks, and "stop" cancels the active thread run.
  • Suggested-action buttons get unique IDs so drilldowns dispatch to the clicked suggestion.
  • Thread conversation history is shared across speakers while personal memory stays speaker-scoped.

AI, API, lint, and cleanup

  • Autumn checkout attach uses the SDK directly so billing metadata reaches Stripe.
  • Flag restores reject target groups that don't belong to the same website.
  • AI goal and link updates preview before applying and skip empty updates; feature flag targets reject blank entries.
  • Business context generation reports research coverage and focused follow-up questions; partial research survives failures without publishing a brief.
  • Lint policy checks every test file is covered by a test script, blocks scratch loopback ports, and pre-commit now covers test files and package manifests.
  • ClickHouse integration tests refuse non-loopback hosts; the retention suite uses the shared ClickHouse client.
  • Removes six unreferenced exports, the dashboard design showcase route, and the smoke e2e suite.

Written for commit 3f5bd75. Summary will update on new commits.

Review in cubic

)

* fix(dashboard): isolate self-host behavior from hosted deployments

* test(dashboard): match complete CSP origins

* test(dashboard): assert CSP origin membership directly
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dashboard (staging) Ready Ready Preview Sep 18, 2026 12:50pm UTC
databuddy-status Ready Ready Preview Sep 18, 2026 12:50pm UTC
documentation (staging) Ready Ready Preview Sep 18, 2026 12:50pm UTC

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 743f2c3a-56e3-4553-94a0-b5285709087c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@railway-app
railway-app Bot temporarily deployed to Databuddy / production September 17, 2026 10:30 Inactive
@vercel
vercel Bot temporarily deployed to staging – documentation September 17, 2026 10:30 Inactive
@vercel
vercel Bot temporarily deployed to staging – dashboard September 17, 2026 10:30 Inactive
@unkey-deploy

unkey-deploy Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 18, 2026 12:50pm

* fix(slack): keep components with streamed responses

* test(slack): use concrete response argument types

* refactor(slack): use native block and button types
The wiring rule now resolves each script's directory, glob, and explicit-file arguments (honoring --path-ignore-patterns and runner-only invocations) instead of accepting any test script, so a file left out of an explicit enumeration like packages/rpc or an insights integration chain is reported. Widens the scratch-port check to all five-digit loopback ports, runs the policy pre-commit for test files and package manifests, and simplifies package discovery.
Bumps [@slack/web-api](https://github.com/slackapi/node-slack-sdk) from 7.17.0 to 8.1.1.
- [Release notes](https://github.com/slackapi/node-slack-sdk/releases)
- [Commits](https://github.com/slackapi/node-slack-sdk/compare/@slack/web-api@7.17.0...@slack/web-api@8.1.1)

---
updated-dependencies:
- dependency-name: "@slack/web-api"
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…abled

The ported ClickHouse suites lost their scratch-port guards and would insert, delete, and create tables on whatever CLICKHOUSE_URL is set; the client now throws under CLICKHOUSE_INTEGRATION_TESTS unless the host is loopback. Moves the ai retention suite onto the shared client (fixing 404s when CLICKHOUSE_URL carries a database path), gives the cohort cleanup hook a real timeout, and ports the last scratch-port case in packages/ai to the shared test database.
@vercel
vercel Bot temporarily deployed to staging – documentation September 18, 2026 09:25 Inactive
@railway-app
railway-app Bot temporarily deployed to Databuddy / production September 18, 2026 09:25 Inactive
izadoesdev and others added 5 commits September 18, 2026 12:28
autumn-js rebuilds every proxied body with sanitizeBody, which drops
metadata along with the customer identity fields, so neither the Dub
customer id nor the existing revenue attribution keys ever reached the
checkout session. Authenticated attach calls now go straight to the SDK
with the billing owner and merged metadata, mirroring the handler's
error shape.
* fix(dashboard): reject blank feature flag targets

* test(dashboard): derive flag targeting inputs from tool schema
* fix(slack): give suggested actions unique button IDs

* docs(slack): note root SDK version overrides

* fix(slack): share the drilldown action ID prefix
#833)

* feat(rpc): retain business research and unanswered questions

* fix(rpc): keep research tied to explicitly selected drafts

* feat(dashboard): show research results and team follow-up questions

* feat(api): report business context research coverage

* test(dashboard): verify research states and document QA

* test(dashboard): guard business context fixture state

---------

Co-authored-by: Issa Nassar <iza@192.168.1.90>
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because checkout attachment can accept an unconfirmed fail-open billing result, and an explicit repository typing requirement must also be satisfied.

Findings

  1. P1 Attach uses fail-open billing
  2. P2 Attach payload lacks explicit type
  3. P2 Core browser coverage removed

Summary

This PR separates hosted and self-host behavior, expands business-context research reporting, strengthens tenant validation, and substantially revises Slack delivery coordination and response streaming.

  • Moves boolean-only environment checks to a configuration-independent helper while preserving hosted defaults.
  • Adds bounded business-context research provenance and focused follow-up questions across API, persistence, and dashboard UI.
  • Adds cross-replica Slack event deduplication, thread locking, stop handling, shared conversation history, and richer streamed blocks.
  • Tightens feature-flag target-group scope and revises billing attach metadata forwarding.
  • Removes the dashboard design showcase and smoke E2E suite.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Env[SELFHOST boolean helper] --> Hosted{Deployment mode}
  Hosted -->|Hosted| HostedAuth[Hosted auth, billing, CSP and snippets]
  Hosted -->|Self-hosted| Local[Local URLs and billing bypasses]
  Dashboard[Dashboard] --> API[API and RPC]
  API --> BusinessContext[Business-context generation]
  BusinessContext --> Research[Validated research report]
  Research --> Dashboard
  SlackEvent[Slack event] --> Dedupe[Redis event claim]
  Dedupe --> Queue[Per-thread queue and lock]
  Queue --> Agent[Shared AI agent]
  Agent --> Stream[Slack streamed response]
  BillingUI[Billing UI] --> Attach[Authenticated Autumn attach]
  Attach --> Autumn[Autumn provider]
Loading

Reviews (1) · Last reviewed commit: "test(dashboard): remove the smoke suite ..."

customerId: string
): Promise<Response> {
try {
const result = await getAutumn().billing.attach({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Attach uses fail-open billing

Authenticated checkout now uses the default Autumn client. That client can accept an unconfirmed 202 response and uses the SDK's default retry and fail-open behavior, so the code may report a successful attachment and invalidate cached customer data without a confirmed purchase. This financial mutation should use the existing strict client.

Suggested change
const result = await getAutumn().billing.attach({
const result = await getAutumn({ strict: true }).billing.attach({

Knowledge Base Used: Billing and entitlements


async function attachWithDubCustomer(
request: Request,
body: Record<string, unknown>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Attach payload lacks explicit type

The new attach boundary declares its payload as Record<string, unknown> and then casts it to the SDK type. The repository requires explicit types instead of any, unknown, or never; the same new pattern also appears in the attach test. Please parse or type this payload against the available AttachParams contract before merging.

Context Used: Basic guidelines for the project so vibe coders don't fuck it up (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@@ -9,11 +9,9 @@
"check-types": "tsc --noEmit",
"test": "bun test --isolate --path-ignore-patterns='test/e2e/**' .",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Core browser coverage removed

Removing the smoke suite also removes the only browser coverage found for authenticated-session bootstrap, unauthenticated route protection, sign-out protection, and persisted profile edits. The full Playwright suite can now pass while these core auth and account journeys are broken. This is non-blocking, but these scenarios should be moved into the regression or core suite before the smoke tests are deleted.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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