Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions packages/remix/src/utils/instrumentServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ function makeWrappedDocumentRequestFunction(
responseStatusCode: number,
responseHeaders: Headers,
context: Record<symbol, unknown>,
loadContext: Record<string, unknown>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be optional as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be. I'll fix it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be. I've pushed a fix for that and the formatting. Sorry for the delay fixing the formatting - I was having trouble getting the repo tooling to work because I'd been using the wrong version of yarn, so it took a while to work out what was wrong.

): Promise<Response> {
let res: Response;

const activeTransaction = getActiveTransaction();
const currentScope = getCurrentHub().getScope();

if (!currentScope) {
return origDocumentRequestFunction.call(this, request, responseStatusCode, responseHeaders, context);
return origDocumentRequestFunction.call(this, request, responseStatusCode, responseHeaders, context, loadContext);
}

try {
Expand All @@ -133,7 +134,7 @@ function makeWrappedDocumentRequestFunction(
},
});

res = await origDocumentRequestFunction.call(this, request, responseStatusCode, responseHeaders, context);
res = await origDocumentRequestFunction.call(this, request, responseStatusCode, responseHeaders, context, loadContext);

span?.finish();
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export interface ServerBuild {
}

export interface HandleDocumentRequestFunction {
(request: RemixRequest, responseStatusCode: number, responseHeaders: Headers, context: EntryContext):
(request: RemixRequest, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext?: AppLoadContext):
| Promise<Response>
| Response;
}
Expand Down