Skip to content

Commit 3a3fa02

Browse files
alexlau811claude
andcommitted
fix: maintain custom sandbox identifier after file changes
When running sandbox with --identifier flag, the custom identifier now persists throughout the entire session, including after file changes trigger rebuilds. Previously, the identifier would fall back to default (whoami) after file changes because printSandboxNameInfo() was called without passing the sandboxIdentifier parameter. Fixes #2874 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 146f603 commit 3a3fa02

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@aws-amplify/sandbox': patch
3+
---
4+
5+
fix: maintain custom sandbox identifier after file changes
6+
7+
The sandbox identifier provided via --identifier flag now persists throughout the entire session, including after file changes trigger rebuilds. Previously, the identifier would fall back to the default (whoami) value after file changes.

packages/sandbox/src/file_watching_sandbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class FileWatchingSandbox extends EventEmitter implements Sandbox {
221221
this.filesChangesTracker.trackFileChange(filePath);
222222
if (latch === 'open') {
223223
this.printer.clearConsole();
224-
await this.printSandboxNameInfo();
224+
await this.printSandboxNameInfo(options.identifier);
225225
}
226226
this.printer.log(
227227
`[Sandbox] Triggered due to a file ${eventName} event: ${path.relative(

0 commit comments

Comments
 (0)