Skip to content

Commit dcb35ff

Browse files
fix: Do not emit :registryUpdated on failure (#3949)
BugBot indicated that my previous PR had a infinite loop in case of the registry failure state: #3948 (comment) We do not need to emit `:registryUpdated` on failure, which should fix this problem. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: a small behavioral change to event emission that only affects failure paths, reducing the chance of update-trigger loops when the registry is unavailable. > > **Overview** > Prevents `SnapRegistryController` from publishing the `SnapRegistryController:registryUpdated` event when `#update()` fails (e.g., fetch/verify errors), while still marking `databaseUnavailable` in state. > > Successful updates and no-op updates (recent fetch or unchanged signature) continue to emit `:registryUpdated` as before. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8af7c86. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent d952951 commit dcb35ff

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

packages/snaps-controllers/src/snaps/registry/SnapRegistryController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ export class SnapRegistryController extends BaseController<
262262
this.update((state) => {
263263
state.databaseUnavailable = true;
264264
});
265-
this.messenger.publish('SnapRegistryController:registryUpdated', false);
266265
}
267266
}
268267

0 commit comments

Comments
 (0)