You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ec00267
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@
90
90
91
91
Work in this release was contributed by @Shubham-Padkonde and @tobias-schnabel. Thank you for your contributions!
92
92
93
-
- **feat(core)**: `Sentry.init()` now warns when it runs while a client is still active. For now, the new client still replaces the active client, but the active client is not closed, so state from both can mix. Call `Sentry.init()` once, or call `await Sentry.close()` before you call it again. `Sentry.close()` now unbinds the client it closes, so after `close()`, `getClient()` returns `undefined`, `isInitialized()` returns `false`, and a later `init()` sets up a new client. In `@sentry/cloudflare`, closing the client also clears the isolate's client cache, so later requests no longer reuse the closed client. On the server, `@sentry/nextjs` and `@sentry/remix` now return the active client from a repeated `init()` call, not `undefined`.
93
+
- **feat(core)**: `Sentry.init()` now warns when it runs while a client is still active. For now, the new client still replaces the active client, but the active client is not closed, so state from both can mix. Call `Sentry.init()` once, or call `await Sentry.close()` before you call it again. `Sentry.close()` now unbinds the client it closes, so after `close()`, `getClient()` returns `undefined`, `isInitialized()` returns `false`, and a later `init()` sets up a new client. In `@sentry/cloudflare`, later requests no longer reuse the isolate's cached client once it is closed or closing. On the server, `@sentry/nextjs` and `@sentry/remix` now return the active client from a repeated `init()` call, not `undefined`.
|`initAndBind` (browser and its wrappers, Deno), Node `_init`, Vercel Edge | Warns, then replaces the client. Returns the new client. |
40
-
| Next.js server, Remix server, Hono Node | Keeps the first client and returns it. Logs in debug mode only. |
41
-
| Hono Bun and Deno | Keeps the first client and returns it. Warns with its own text. |
42
-
| Nuxt server | Keeps the first client and returns it. Logs that a `--import` preload is no longer needed. |
43
-
| Cloudflare (default) | Keeps the first client of the isolate and returns it. Closing that client clears the cache. `cacheClient: false` makes a new client on each call, with no warning. |
44
-
| Next.js edge | Warns, then replaces the client. Returns `void`. |
|`initAndBind` (browser and its wrappers, Deno), Node `_init`, Vercel Edge | Warns, then replaces the client. Returns the new client. |
40
+
| Next.js server, Remix server, Hono Node | Keeps the first client and returns it. Logs in debug mode only. |
41
+
| Hono Bun and Deno | Keeps the first client and returns it. Warns with its own text. |
42
+
| Nuxt server | Keeps the first client and returns it. Logs that a `--import` preload is no longer needed. |
43
+
| Cloudflare (default) | Keeps the first client of the isolate and returns it, unless that client is closed or closing. `cacheClient: false` makes a new client on each call, with no warning. |
44
+
| Next.js edge | Warns, then replaces the client. Returns `void`. |
45
45
46
46
The shared warning lives in `warnIfClientIsActive()` in
'[Sentry] init() was called with a different DSN than the cached client of this isolate; the cached client keeps its DSN. Pass `cacheClient: false` for per-invocation options.',
@@ -145,12 +147,6 @@ export function initWithDefaultIntegrations(
145
147
146
148
if(cacheEnabled&&client){
147
149
cacheClient(client);
148
-
// A closed client drops all data, so the next `init()` must not reuse it.
149
-
client.on('close',()=>{
150
-
if(getCachedClient()===client){
151
-
_clearGlobalClientCache();
152
-
}
153
-
});
154
150
}
155
151
156
152
// An instrumented module that first evaluates AFTER this init (e.g. a driver
0 commit comments