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: reuse shared death-clock invalidation in overview (#8554)

[._.]/ Adam Eivyf5258714737c
diff --git a/client/src/components/meatspace/tabs/OverviewTab.jsx b/client/src/components/meatspace/tabs/OverviewTab.jsx
index d6d2edfef4..c10bdd9677 100644
--- a/client/src/components/meatspace/tabs/OverviewTab.jsx
+++ b/client/src/components/meatspace/tabs/OverviewTab.jsx
@@ -147,12 +147,14 @@ function riskColor(level) {
return 'text-port-error';
}
-const OVERVIEW_EVENTS = ['meatspace:changed'];
+const OVERVIEW_EVENTS = ['meatspace:changed', 'meatspace:death-clock:changed'];
const fetchHealthBody = () => api.getLatestHealthMetrics(['body_mass', 'body_fat_percentage', 'lean_body_mass']);
function useOverviewResource(resource, fetchResource) {
return useSocketResource(fetchResource, {
events: OVERVIEW_EVENTS,
- matchesEvent: payload => payload?.resources?.includes(resource),
+ matchesEvent: (payload, event) => event === 'meatspace:death-clock:changed'
+ ? resource === 'overview' || resource === 'calendar'
+ : payload?.resources?.includes(resource),
});
}
diff --git a/client/src/components/meatspace/tabs/OverviewTab.test.jsx b/client/src/components/meatspace/tabs/OverviewTab.test.jsx
index 4f493944fd..922a63a744 100644
--- a/client/src/components/meatspace/tabs/OverviewTab.test.jsx
+++ b/client/src/components/meatspace/tabs/OverviewTab.test.jsx
@@ -50,6 +50,13 @@ it('renders local and mirrored invalidations selectively, retaining good data on
api.getBodyHistory.mockRejectedValue(new Error('temporarily unavailable'));
await act(async () => { socket.emit('meatspace:changed', { resources: ['body'] }); });
expect(screen.getByText('172 lbs')).toBeInTheDocument();
+
+ api.getMeatspaceOverview.mockResolvedValue({ summary: { totalEntries: 1234 } });
+ await act(async () => { socket.emit('meatspace:death-clock:changed', {}); });
+ expect(screen.getByText('1234')).toBeInTheDocument();
+ expect(api.getMeatspaceOverview).toHaveBeenCalledTimes(3);
+ expect(api.getLifeCalendar).toHaveBeenCalledTimes(2);
+ expect(api.getBodyHistory).toHaveBeenCalledTimes(3);
});
it('reconciles each resource once on reconnect and once on tab re-show, then unsubscribes', async () => {
diff --git a/server/services/identity/longevity.js b/server/services/identity/longevity.js
index 9805d38660..ba2ab7d693 100644
--- a/server/services/identity/longevity.js
+++ b/server/services/identity/longevity.js
@@ -1,4 +1,3 @@
-import { invalidateMeatspace } from '../meatspaceEvents.js';
import { getGenomeSummary } from '../genome.js';
import {
GOALS_FILE,
@@ -79,7 +78,6 @@ export async function deriveLongevity(birthDate) {
};
await saveJSON(LONGEVITY_FILE, longevity);
- invalidateMeatspace(['overview', 'calendar']);
const markerCount = Object.keys(longevityMarkers).length + Object.keys(cardiovascularMarkers).length;
console.log(`🧬 Longevity derived: ${lifeExpectancy.adjusted}y (${markerCount} markers, confidence: ${confidence})`);