Skip to content

Commit 277ed60

Browse files
msukkariclaude
andcommitted
refactor(web): remove redundant api_code_search_request event
This event is fully covered by api_request which fires for every API call and carries path + source. Updated the Any Feature Usage PostHog action to remove the api_code_search_request step. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent df039d0 commit 277ed60

3 files changed

Lines changed: 0 additions & 18 deletions

File tree

packages/web/src/app/api/(server)/search/route.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { search, searchRequestSchema } from "@/features/search";
44
import { apiHandler } from "@/lib/apiHandler";
5-
import { captureEvent } from "@/lib/posthog";
65
import { requestBodySchemaValidationError, serviceErrorResponse } from "@/lib/serviceError";
76
import { isServiceError } from "@/lib/utils";
87
import { NextRequest } from "next/server";
@@ -21,12 +20,6 @@ export const POST = apiHandler(async (request: NextRequest) => {
2120
...options
2221
} = parsed.data;
2322

24-
const source = request.headers.get('X-Sourcebot-Client-Source') ?? 'unknown';
25-
await captureEvent('api_code_search_request', {
26-
source,
27-
type: 'blocking',
28-
});
29-
3023
const response = await search({
3124
queryType: 'string',
3225
query,

packages/web/src/app/api/(server)/stream_search/route.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { streamSearch, searchRequestSchema } from '@/features/search';
44
import { apiHandler } from '@/lib/apiHandler';
5-
import { captureEvent } from '@/lib/posthog';
65
import { requestBodySchemaValidationError, serviceErrorResponse } from '@/lib/serviceError';
76
import { isServiceError } from '@/lib/utils';
87
import { NextRequest } from 'next/server';
@@ -20,12 +19,6 @@ export const POST = apiHandler(async (request: NextRequest) => {
2019
...options
2120
} = parsed.data;
2221

23-
const source = request.headers.get('X-Sourcebot-Client-Source') ?? 'unknown';
24-
await captureEvent('api_code_search_request', {
25-
source,
26-
type: 'streamed',
27-
});
28-
2922
const stream = await streamSearch({
3023
queryType: 'string',
3124
query,

packages/web/src/lib/posthogEvents.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,6 @@ export type PosthogEventMap = {
297297
//////////////////////////////////////////////////////////////////
298298
wa_repo_not_found_for_zoekt_file: {},
299299
//////////////////////////////////////////////////////////////////
300-
api_code_search_request: {
301-
source: string;
302-
type: 'streamed' | 'blocking';
303-
},
304300
api_request: {
305301
path: string;
306302
source: string;

0 commit comments

Comments
 (0)