Skip to content

Commit 22c2c92

Browse files
committed
fix(core): Make endTimestamp of FetchBreadcrumbHint optional
Signed-off-by: Kaung Zin Hein <83657429+Zen-cronic@users.noreply.github.com>
1 parent a3a36e3 commit 22c2c92

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/browser/src/integrations/graphqlClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function _getGraphQLOperation(requestBody: GraphQLRequestPayload): string {
119119

120120
/**
121121
* Get the request body/payload based on the shape of the hint.
122-
*
122+
*
123123
* Exported for tests only.
124124
*/
125125
export function getRequestPayloadXhrOrFetch(hint: XhrHint | FetchHint): string | undefined {
@@ -140,7 +140,7 @@ export function getRequestPayloadXhrOrFetch(hint: XhrHint | FetchHint): string |
140140

141141
/**
142142
* Extract the name and type of the operation from the GraphQL query.
143-
*
143+
*
144144
* Exported for tests only.
145145
*/
146146
export function parseGraphQLQuery(query: string): GraphQLOperation {

packages/core/src/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function instrumentFetchRequest(
104104
input: handlerData.args,
105105
response: handlerData.response,
106106
startTimestamp: handlerData.startTimestamp,
107-
endTimestamp: handlerData.endTimestamp ?? Date.now(),
107+
endTimestamp: handlerData.endTimestamp,
108108
} satisfies FetchBreadcrumbHint;
109109

110110
client.emit('beforeOutgoingRequestSpan', span, fetchHint);

packages/core/src/types-hoist/breadcrumb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export interface FetchBreadcrumbHint {
9494
data?: unknown;
9595
response?: unknown;
9696
startTimestamp: number;
97-
endTimestamp: number;
97+
endTimestamp?: number;
9898
}
9999

100100
export interface XhrBreadcrumbHint {

0 commit comments

Comments
 (0)