Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): surface sync errors + generate from edited name

[._.]/ Adam Eivy5752390e4d27
diff --git a/client/src/pages/Catalog.jsx b/client/src/pages/Catalog.jsx
index 61e13d07cb..9698acbfc4 100644
--- a/client/src/pages/Catalog.jsx
+++ b/client/src/pages/Catalog.jsx
@@ -194,12 +194,23 @@ export default function Catalog() {
});
setSyncing(false);
if (!result) return;
- const promoted = result?.stats?.promoted ?? result?.promoted ?? 0;
- toast.success(
- promoted > 0
- ? `Synced ${promoted} canon item${promoted === 1 ? '' : 's'} into the catalog`
- : 'Catalog already up to date with your universes',
- );
+ // migrateBibleToCatalog catches per-entry failures and reports them in
+ // stats.errors — don't let a partial/failed walk read as "all good."
+ const stats = result?.stats ?? result ?? {};
+ const promoted = stats.promoted ?? 0;
+ const errors = stats.errors ?? 0;
+ if (errors > 0) {
+ toast.error(
+ `Sync hit ${errors} error${errors === 1 ? '' : 's'}` +
+ `${promoted > 0 ? ` (${promoted} promoted)` : ''} — some canon items may still be missing`,
+ );
+ } else {
+ toast.success(
+ promoted > 0
+ ? `Synced ${promoted} canon item${promoted === 1 ? '' : 's'} into the catalog`
+ : 'Catalog already up to date with your universes',
+ );
+ }
if (promoted > 0) {
loadItems();
loadStats();
diff --git a/client/src/pages/Catalog.test.jsx b/client/src/pages/Catalog.test.jsx
index 34252bcafe..cc0b0b65bd 100644
--- a/client/src/pages/Catalog.test.jsx
+++ b/client/src/pages/Catalog.test.jsx
@@ -199,6 +199,19 @@ describe('Catalog page', () => {
expect(listCatalogIngredients.mock.calls.length).toBe(callsBefore);
});
+ it('surfaces an error toast (not a success) when the sync reports errors', async () => {
+ rerunCatalogMigration.mockResolvedValue({ stats: { promoted: 0, errors: 2 } });
+ renderCatalog();
+ await waitFor(() => expect(screen.getByText('Echo Saint')).toBeTruthy());
+
+ await act(async () => {
+ fireEvent.click(screen.getByRole('button', { name: /Sync from Universes/i }));
+ });
+
+ expect(toast.error).toHaveBeenCalledWith(expect.stringMatching(/Sync hit 2 errors/i));
+ expect(toast.success).not.toHaveBeenCalledWith(expect.stringMatching(/up to date/i));
+ });
+
it('renders a card thumbnail when the ingredient has a thumbnail key', async () => {
listCatalogIngredients.mockResolvedValue({
items: [{ ...sample[0], thumbnailKey: 'hero.png' }],
diff --git a/client/src/pages/CatalogIngredient.jsx b/client/src/pages/CatalogIngredient.jsx
index 2afebb9758..626e0c4981 100644
--- a/client/src/pages/CatalogIngredient.jsx
+++ b/client/src/pages/CatalogIngredient.jsx
@@ -463,7 +463,7 @@ export default function CatalogIngredient() {
onAttach={handleAttachMedia}
onSetPortrait={handleSetPortrait}
onDetach={handleDetachMedia}
- genName={record.name}
+ genName={name}
genDescription={genDescription}
onGenerated={handleGeneratedImage}
/>