diff --git a/.changeset/fix-sandbox-identifier-persistence.md b/.changeset/fix-sandbox-identifier-persistence.md new file mode 100644 index 00000000000..5efc9840116 --- /dev/null +++ b/.changeset/fix-sandbox-identifier-persistence.md @@ -0,0 +1,7 @@ +--- +'@aws-amplify/sandbox': patch +--- + +fix: maintain custom sandbox identifier after file changes + +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. diff --git a/packages/sandbox/src/file_watching_sandbox.ts b/packages/sandbox/src/file_watching_sandbox.ts index f5076416dfe..455ce275b16 100644 --- a/packages/sandbox/src/file_watching_sandbox.ts +++ b/packages/sandbox/src/file_watching_sandbox.ts @@ -221,7 +221,7 @@ export class FileWatchingSandbox extends EventEmitter implements Sandbox { this.filesChangesTracker.trackFileChange(filePath); if (latch === 'open') { this.printer.clearConsole(); - await this.printSandboxNameInfo(); + await this.printSandboxNameInfo(options.identifier); } this.printer.log( `[Sandbox] Triggered due to a file ${eventName} event: ${path.relative(