Skip to content

Commit

Permalink
fix(daemon): pet-store removes petname when overwriting with write
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis committed Dec 1, 2023
1 parent 5769393 commit 6050df8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/daemon/src/pet-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ export const makePetStoreMaker = (filePowers, locator) => {
throw new Error(`Invalid formula identifier ${q(formulaIdentifier)}`);
}

if (petNames.has(petName)) {
// Perform cleanup on the overwritten pet name.
const formulaPetNames = formulaIdentifiers.get(petName);
if (formulaPetNames !== undefined) {
formulaPetNames.delete(petName);
}
changesTopic.publisher.next({ remove: petName });
}

petNames.set(petName, formulaIdentifier);

const formulaPetNames = formulaIdentifiers.get(formulaIdentifier);
Expand Down

0 comments on commit 6050df8

Please sign in to comment.