hiroshinishio / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
0 stars 0 forks source link

Broken custom dataloader methods #7

Open hiroshinishio opened 1 week ago

hiroshinishio commented 1 week ago

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 https://github.com/getsentry/sentry-javascript/pull/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
gitauto-ai[bot] commented 1 week ago

Click the checkbox below to generate a PR!

@hiroshinishio, You have 5 requests left in this cycle which refreshes on 2024-11-04 02:56:25+00:00. If you have any questions or concerns, please contact us at info@gitauto.ai.

gitauto-ai[bot] commented 1 week ago

Sorry, we have an error. Please try again.

Have feedback or need help? Feel free to email info@gitauto.ai.