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: answer a missing idle-loop track as a prerequisite, not a registry error

[._.]/ Adam Eivyf8a46a6e5ffd
diff --git a/.changelog/NEXT.md b/.changelog/v2.36.0.md
similarity index 100%
rename from .changelog/NEXT.md
rename to .changelog/v2.36.0.md
diff --git a/server/services/sprites/presentationIdle.js b/server/services/sprites/presentationIdle.js
index 573f38e5d6..dced4fd90b 100644
--- a/server/services/sprites/presentationIdle.js
+++ b/server/services/sprites/presentationIdle.js
@@ -9,6 +9,8 @@ import { basename } from 'path';
import sharp from 'sharp';
import { ServerError } from '../../lib/errorHandler.js';
import { keyChannelSplit } from './chromaKey.js';
+import { isAnimationTrack } from './animationTracks.js';
+import { getEffectiveAnimationTracks } from './animationTrackStore.js';
import { getTrackState } from './animationTrackWorkflow.js';
import { resolveSpriteAssetPath } from './paths.js';
import { loadManifest } from './reference.js';
@@ -81,6 +83,18 @@ export async function composePresentationIdleStrip(frameBytes, chromaKey) {
}
export async function buildPresentationIdle(recordId) {
+ // `idle-loop` is a user-authored track, not a shipped one (#3152 moved every
+ // non-walk row into the editable registry). On an install that never created
+ // it, `getTrackState` resolves the id through the registry, which THROWS a
+ // bare "Unknown animation track" Error — a 500 naming internals, on the same
+ // publish the UI offers unconditionally. Answer it as the missing prerequisite
+ // it is, alongside the not-yet-approved case below.
+ if (!isAnimationTrack(PRESENTATION_IDLE_TRACK_ID, getEffectiveAnimationTracks())) {
+ throw idleError(
+ `Create an animation track named '${PRESENTATION_IDLE_TRACK_ID}' and approve it before publishing a picker animation`,
+ 'PRESENTATION_IDLE_TRACK_REQUIRED',
+ );
+ }
const [record, referenceManifest, state] = await Promise.all([
getRecord(recordId),
loadManifest(recordId),
diff --git a/server/services/sprites/presentationIdle.test.js b/server/services/sprites/presentationIdle.test.js
index 9132fc96b9..3bd4dc2e6a 100644
--- a/server/services/sprites/presentationIdle.test.js
+++ b/server/services/sprites/presentationIdle.test.js
@@ -1,6 +1,18 @@
-import { describe, expect, it } from 'vitest';
+import { describe, expect, it, vi } from 'vitest';
import sharp from 'sharp';
+
+// The registry table this module consults, pinned to a install that never
+// authored an `idle-loop` track — the default state of every install, since
+// #3152 made every non-walk track user-defined. Reading the real table would
+// make the assertion below depend on whichever tracks THIS machine happens to
+// have authored.
+vi.mock('./animationTrackStore.js', async (importOriginal) => ({
+ ...(await importOriginal()),
+ getEffectiveAnimationTracks: () => ({ walk: { id: 'walk' } }),
+}));
+
import {
+ buildPresentationIdle,
buildPresentationIdleLayout,
composePresentationIdleStrip,
PRESENTATION_IDLE_CELL_SIZE,
@@ -61,4 +73,16 @@ describe('presentation idle strip', () => {
cellSize: 512,
});
});
+
+ it('answers a missing idle-loop track as a prerequisite, not an internal registry error', async () => {
+ // The publish form offers the picker-idle path unconditionally, so an
+ // install that never created the track reaches here. Resolving the id
+ // through the registry throws a bare Error naming the known tracks — a 500
+ // about internals. It must arrive as the same 422 the not-yet-approved case
+ // gets, so the UI can tell the user what to create.
+ await expect(buildPresentationIdle('rec-1')).rejects.toMatchObject({
+ status: 422,
+ code: 'PRESENTATION_IDLE_TRACK_REQUIRED',
+ });
+ });
});