E2B icon indicating copy to clipboard operation
E2B copied to clipboard

[Bug]: Passed Credential in Sandbox.connect, does not get used in `.pause` method like in `.kill`

Open OpeOginni opened this issue 8 months ago • 2 comments

Version of JS SDK : 2.14.1

When making use of the SDK you can connect to an existing sandbox using the connect method and passing in an API key.

This allows for the use of the .kill() command normally, but .pause does not work and requires the apiKey field passed in again.

const mySandbox = Sandbox.connect(externalId, {
      apiKey,
    })

mySandbox.kill() // Works as should

mySandbox.pause() // Fails with auth issue, only works when apiKey is passed as a param

It would be cool to have pause work without passing in the apiKey again like .kill.

Please close the Issue and my PR if this is desired behaviour, I made this issue as a user, it was confusing and decided to go ahead and make a fix. Thank you!

OpeOginni avatar Mar 19 '26 12:03 OpeOginni

ENG-3573

linear[bot] avatar Mar 19 '26 12:03 linear[bot]

Hi! I've submitted PR #1230 to fix this issue.

The fix ensures that pause() and betaPause() now properly use the connection config (including the API key) that was passed to Sandbox.connect(), just like kill() already does.

This was a simple two-line change that aligns the behavior across all lifecycle methods. Please review when you have time!

goingforstudying-ctrl avatar Mar 23 '26 00:03 goingforstudying-ctrl