Skip to content

Commit 276efc0

Browse files
Remove unnecessary existing session check (#143)
* Remove unnecessary existing session check * Add changeset
1 parent c39674b commit 276efc0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/odd-beds-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/sandbox": patch
3+
---
4+
5+
Remove unnecessary existing session check

packages/sandbox/src/sandbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export class Sandbox<Env = unknown> extends Container<Env> implements ISandbox {
284284
this.logger.debug('Default session initialized', { sessionId });
285285
} catch (error: any) {
286286
// If session already exists (e.g., after hot reload), reuse it
287-
if (error?.message?.includes('already exists') || error?.message?.includes('Session')) {
287+
if (error?.message?.includes('already exists')) {
288288
this.logger.debug('Reusing existing session after reload', { sessionId });
289289
this.defaultSession = sessionId;
290290
// Persist to storage in case it wasn't saved before

0 commit comments

Comments
 (0)