Skip to content

Broken custom dataloader methods #7

Open
@hiroshinishio

Description

@hiroshinishio

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.33.1

Framework Version

fastify 5.0.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

The automated dataloader integration added in getsentry#13664 breaks my code.

I have a dataloader like this:

export class ProductDataloader extends DataLoader {
    constructor() {
        super(async (globalIds: ReadonlyArray<string>) => {
            return batchFn(globalIds);
        });
    }

    public async loadByInternalId(id: number) {
        const globalId = toGlobalId('Product', id);
        return this.load(globalId);
    }
}

Expected Result

That code worked OK until "@sentry/node": "8.30.0"

Actual Result

After upgrade to "@sentry/node": "8.31.0" or later, calling loadByInternalId method fails:

context.dataloaders.product.loadByInternalId is not a function

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions