getsentry / getsentry/sentry-javascript

hono: Double `init()` behaves differently per runtime

未关闭
#24,049 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Bug Bun javascript
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
523

描述

```
node : same client after 2nd init? true | release now: 1.0.0
bun : same client after 2nd init? false | release now: 2.0.0
(plus a console warning)
```

`hono/src/node/sdk.ts:15` returns the existing client and skips re-initialization. `hono/src/bun/sdk.ts:17` and `hono/src/deno/sdk.ts:17` warn and then re-initialize anyway, replacing the client. Anything buffered on the first client is dropped, and its integrations stay installed against a dead client.

The Hono docs tell users to init through the `sentry()` middleware, so a user who also calls `Sentry.init()` hits exactly this path.

**Work item.** Make all four entries behave the same way. Returning the existing client (the Node behavior) is the safer default. Keep the loud warning from bun/deno on all of them.

**Prior art **[#21176]() asked for the Bun middleware to follow the Node pattern. getsentry/sentry-javascript#21195 closed it by adding the warning only. The behavior divergence this item describes is what is left over: bun and deno warn and then re-initialize anyway.

贡献指南

打开贡献指南

调研方向

Start with hono/src/node/sdk.ts:15 and compare it with hono/src/bun/sdk.ts:17 and hono/src/deno/sdk.ts:17, then locate the fourth runtime entry. Check the initialization and warning behavior across all four entries. Done means every runtime warns on a second init while preserving and returning the existing client rather than replacing it.

由索引模型根据 Issue 内容生成。

评估

技术栈
bun, deno, nodejs, typescript
领域
backend, observability
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
描述清楚
新手友好度
76/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。