Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Env {
SENTRY_DSN: string;
}

const ai = instrumentWorkersAiClient(new MockAi());
const ai = instrumentWorkersAiClient(new MockAi(), { recordInputs: false, recordOutputs: false });

export default Sentry.withSentry(
(env: Env) => ({
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/types/datacollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export interface DataCollection {
*/
httpBodies?: HttpBodyCollectionTarget[];

/** @deprecated Use `urlQueryParams` instead. */
queryParams?: CollectBehavior;

/**
* Controls URL query parameter collection and sensitive value filtering.
* @default true
Expand Down Expand Up @@ -112,8 +109,7 @@ export interface DataCollection {
/**
* Fully resolved `DataCollection` with all defaults applied.
*/
// todo(v11): change `Omit<DataCollection, 'queryParams'>` to just `DataCollection`
export type ResolvedDataCollection = Required<Omit<DataCollection, 'queryParams'>> & {
export type ResolvedDataCollection = Required<DataCollection> & {
httpHeaders: Required<NonNullable<DataCollection['httpHeaders']>>;
graphQL: Required<NonNullable<DataCollection['graphQL']>>;
genAI: Required<NonNullable<DataCollection['genAI']>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export function resolveDataCollectionOptions(options: {
response: dc.httpHeaders?.response ?? base.httpHeaders.response,
},
httpBodies: dc.httpBodies ?? base.httpBodies,
// oxlint-disable-next-line typescript/no-deprecated
urlQueryParams: dc.urlQueryParams ?? dc.queryParams ?? base.urlQueryParams,
urlQueryParams: dc.urlQueryParams ?? base.urlQueryParams,
graphQL: {
document: dc.graphQL?.document ?? base.graphQL.document,
variables: dc.graphQL?.variables ?? base.graphQL.variables,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,36 +213,4 @@ describe('resolveDataCollectionOptions', () => {
expect(result).toHaveProperty('frameContextLines');
});
});

describe('deprecated queryParams alias', () => {
it('honors deprecated queryParams when urlQueryParams is not set', () => {
expect(resolveDataCollectionOptions({ dataCollection: { queryParams: false } }).urlQueryParams).toBe(false);

expect(
resolveDataCollectionOptions({ dataCollection: { queryParams: { deny: ['token'] } } }).urlQueryParams,
).toEqual({ deny: ['token'] });
});

it('prefers urlQueryParams over the deprecated queryParams when both are set', () => {
// new field wins, even when it is the "off" value
expect(
resolveDataCollectionOptions({ dataCollection: { urlQueryParams: false, queryParams: true } }).urlQueryParams,
).toBe(false);

expect(
resolveDataCollectionOptions({ dataCollection: { urlQueryParams: true, queryParams: false } }).urlQueryParams,
).toBe(true);
});

it('falls back to the default when neither is set', () => {
// dataCollection provided → spec default (collect)
expect(resolveDataCollectionOptions({ dataCollection: {} }).urlQueryParams).toBe(true);
});

it('does not leak the deprecated queryParams key into the resolved output', () => {
const result = resolveDataCollectionOptions({ dataCollection: { queryParams: false } });
expect(result).not.toHaveProperty('queryParams');
expect(Object.keys(result)).toHaveLength(10);
});
});
});
Loading