getsentry / getsentry/sentry-javascript

Elysia events report as `sentry.javascript.bun`

Abierto Apto para principiantes
#24,046 1 comentario 0 reacciones 0 asignados Ver en GitHub
Bug Bun javascript
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
523

Descripción

Running under both node and bun, with the built `@sentry/elysia`:

```
sdk: {"name":"sentry.javascript.bun","version":"10.67.0",
"packages":[{"name":"npm:@sentry/bun","version":"10.67.0"}]}
```

`sentry.javascript.elysia` never appears. `packages/elysia/src/sdk.ts:44`copies `userOptions` into `options` *before* calling `applySdkMetadata(userOptions, 'elysia', ...)`. When `userOptions._metadata` is undefined, `applySdkMetadata` creates a fresh `_metadata` on `userOptions`, which the already-made copy does not have. `initBun(options)` then applies its own `'bun'` metadata to the copy.

The Elysia SDK is invisible in SDK adoption telemetry, and support cannot tell Elysia reports from plain Bun ones.

**Work item.** Call `applySdkMetadata(options, ...)` on the copy, or move the call above the spread. One-line fix. Add an assertion to `packages/elysia/test` that `event.sdk.name === 'sentry.javascript.elysia'`.

**Prior art** the identical bug was already found and fixed one package over: [#15458]()/[#15459]() "fix(bun): Includes correct sdk metadata". That PR also added the SDK-metadata assertion to the Bun tests, which is the test to copy here.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start at packages/elysia/src/sdk.ts:44 and inspect how userOptions is copied before applySdkMetadata runs. Make the metadata call target the copied options or move it before the spread, then add the SDK-name assertion in packages/elysia/test, following the assertion added to the Bun tests in #15459. Done means the test sees event.sdk.name as sentry.javascript.elysia.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
bun, node.js, typescript
Área
backend, testing-qa
Tipo de issue
Error
Dificultad
1/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
92/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.