[Bug]: Passed Credential in Sandbox.connect, does not get used in `.pause` method like in `.kill`
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!
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!