mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
<!-- claude-slack-attribution --> _Requested via [Slack thread](https://supabase.slack.com/archives/C076KTY11DF/p1794187436590809?thread_ts=1794187436.590809&cid=C076KTY11DF)_ ## Problem **Before:** `docs_search_v2_ask_ai_question_submitted` sent the user's Ask AI question, cut to its first 300 characters, as a `question` property (added in #52459). Free-text questions can contain personal data such as names, emails, pasted logs, or connection strings. **After:** the event sends only `questionLength` and `questionSource`. No question text leaves the browser. This matches `kb_search_submitted`, which already leaves the query text out and sends only its length. Linear: [GROWTH-1458](https://linear.app/supabase/issue/GROWTH-1458/stop-sending-ask-ai-question-text-in-docs-search-v2-ask-ai-question) ## Solution - `packages/common/telemetry-constants.ts`: remove `question` from `DocsSearchV2AskAiQuestionSubmittedEvent` and note in the event doc that the question text is left out, as `KbSearchSubmittedEvent` does. - `apps/docs/features/SearchV2/AskAiPanel.tsx` (typed questions) and `SearchV2Provider.tsx` (questions carried over from search): drop the `question` property. - `apps/docs/features/SearchV2/constants.ts`: delete `ASK_AI_QUESTION_TELEMETRY_LENGTH`, which nothing uses now. - `SearchV2.telemetry.test.tsx`: replace the truncation test with one that checks a typed question sends exactly `{ questionLength, questionSource: 'typed' }`, has no `question` property, and does not contain the question text. Out of scope: `docs_search_v2_search_submitted.query` and `docs_search_v2_result_clicked.query` stay as they are. ## Review instructions 1. Check that the event type in `telemetry-constants.ts` no longer has `question`, and that typecheck enforces this at both call sites. 2. Run `pnpm vitest --run features/SearchV2` in `apps/docs`. All 33 tests pass locally. 3. `tsc --noEmit` passes in `apps/docs` (after `codegen:graphql`) and `packages/common`. Prettier is clean on changed files. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) (not applicable: no docs content changed) --- _Generated by [Claude Code](https://claude.ai/code/session_011aGhSD3LLt9nZYbsWkZBjJ)_ Co-authored-by: Claude <noreply@anthropic.com>