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

fix: reduce update banner activity polling overhead

[._.]/ Adam Eivy3b546adef784
diff --git a/client/src/components/UpdateBanners.jsx b/client/src/components/UpdateBanners.jsx
index c6e5dde38f..6446c4e8a5 100644
--- a/client/src/components/UpdateBanners.jsx
+++ b/client/src/components/UpdateBanners.jsx
@@ -15,15 +15,15 @@ export default function UpdateBanners() {
} = useUpdateChecker();
const hasAdvisory = Boolean(update || outOfSync);
- const { data: processing } = useAutoRefetch(() => api.getActiveProcessing({ silent: true }), 3000, {
- enabled: hasAdvisory,
- });
+ const { data: jobsActive } = useAutoRefetch(async () => {
+ const processing = await api.getActiveProcessing({ silent: true });
+ return processing.agents?.active > 0
+ || processing.jobs?.length > 0
+ || processing.extras?.imageTo3d?.length > 0;
+ }, 15000, { enabled: hasAdvisory });
// Keep advisories pending until activity is known and jobs have drained.
// Hiding must not dismiss them: they become actionable again when idle.
- const jobsActive = processing?.agents?.active > 0
- || processing?.jobs?.length > 0
- || processing?.extras?.imageTo3d?.length > 0;
- if (!hasAdvisory || !processing || jobsActive) return null;
+ if (!hasAdvisory || jobsActive !== false) return null;
const goToUpdate = () => navigate(`/apps/${api.PORTOS_APP_ID}/update`);
diff --git a/client/src/components/UpdateBanners.test.jsx b/client/src/components/UpdateBanners.test.jsx
index adbe74730b..e36d63ad04 100644
--- a/client/src/components/UpdateBanners.test.jsx
+++ b/client/src/components/UpdateBanners.test.jsx
@@ -80,12 +80,12 @@ describe('UpdateBanners', () => {
expect(screen.queryByRole('status')).toBeNull();
getActiveProcessing.mockResolvedValue({ agents: { active: 0 }, jobs: [] });
- await act(async () => { await vi.advanceTimersByTimeAsync(3000); });
+ await act(async () => { await vi.advanceTimersByTimeAsync(15000); });
expect(screen.getByRole('button', { name: 'Reconcile' })).toBeTruthy();
expect(screen.getByRole('button', { name: 'Update' })).toBeTruthy();
getActiveProcessing.mockResolvedValue(busy);
- await act(async () => { await vi.advanceTimersByTimeAsync(3000); });
+ await act(async () => { await vi.advanceTimersByTimeAsync(15000); });
expect(screen.queryByRole('status')).toBeNull();
expect(localStorage.getItem(__internal.OUT_OF_SYNC_DISMISS_KEY)).toBeNull();
expect(ignoreUpdateVersion).not.toHaveBeenCalled();