Skip to content

Commit fffe589

Browse files
committed
ref: PR feedback
1 parent a0a8734 commit fffe589

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/core/src/baseclient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -806,19 +806,19 @@ function _validateBeforeSendResult(
806806
/**
807807
* Process the matching `beforeSendXXX` callback.
808808
*/
809-
function processBeforeSend<T extends Event>(
809+
function processBeforeSend(
810810
options: ClientOptions,
811-
event: T,
811+
event: Event,
812812
hint: EventHint,
813-
): PromiseLike<T | null> | T | null {
813+
): PromiseLike<Event | null> | Event | null {
814814
const { beforeSend, beforeSendTransaction } = options;
815815

816816
if (isErrorEvent(event) && beforeSend) {
817-
return beforeSend(event, hint) as PromiseLike<T | null> | T | null;
817+
return beforeSend(event, hint);
818818
}
819819

820820
if (isTransactionEvent(event) && beforeSendTransaction) {
821-
return beforeSendTransaction(event, hint) as PromiseLike<T | null> | T | null;
821+
return beforeSendTransaction(event, hint);
822822
}
823823

824824
return event;

packages/types/src/options.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
229229
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
230230
* it at the end. Returning `null` will cause the event to be dropped.
231231
*
232+
* TODO v8: Narrow the response type to `ErrorEvent` - this is technically a breaking change.
233+
*
232234
* @param event The error or message event generated by the SDK.
233235
* @param hint Event metadata useful for processing.
234236
* @returns A new event that will be sent | null.
@@ -242,6 +244,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
242244
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
243245
* it at the end. Returning `null` will cause the event to be dropped.
244246
*
247+
* TODO v8: Narrow the response type to `TransactionEvent` - this is technically a breaking change.
248+
*
245249
* @param event The error or message event generated by the SDK.
246250
* @param hint Event metadata useful for processing.
247251
* @returns A new event that will be sent | null.

0 commit comments

Comments
 (0)