Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

test(web): update params migration version expectations

joshistoast6549b9978466
diff --git a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
index 9a6720b85b..b8fb40b2b8 100644
--- a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
@@ -172,11 +172,10 @@ describe('paramsSlice selectors for external models', () => {
* `animaT5EncoderModel`, since removed from the schema.
* - v4: the narrowest v4 blob is not a release at all — it is the one written by the build that did
* the bump, `1aeb05bbf0` (97 keys). Releases writing v4 start at v6.14.0-rc1.
- * - v5: the current version, reached by the FLUX.2 [dev] merge `f10d2a4f5a`, which is also the
- * build that wrote the narrowest v5 blob. Pinning the fixture at the bump commit is what keeps
- * the invariant below meaningful for the current tier: the version steps can never cover it (a
- * v5 blob matches no branch), so every key added since the bump has to carry a zod default, and
- * this entry is what proves it does.
+ * - v5: reached by the FLUX.2 [dev] merge `f10d2a4f5a`, which is also the build that wrote the
+ * narrowest v5 blob. It is historical now: the v5 -> v8 steps must seed every required field
+ * that this fixture predates, while any field added to the current v8 tier still needs a zod
+ * default because no migration step can cover a blob already at that version.
*/
const RELEASE_PARAMS_KEYS = {
'v6.0.0a1': {
@@ -1234,7 +1233,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(blob) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.positivePrompt).toBe('a fluffy cat');
expect(result.seed).toBe(42);
expect(result.shouldRandomizeSeed).toBe(false);
@@ -1400,7 +1399,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(blob) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.dimensions).toEqual(getInitialParamsState().dimensions);
expect(result.positivePrompt).toBe('a fluffy cat');
expect(result.seed).toBe(7);
@@ -1417,7 +1416,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(blob) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.positivePromptHistory).toEqual([]);
expect(result.qwenImageVaeModel).toBeNull();
expect(result.wanVaeModel).toBeNull();
@@ -1427,18 +1426,18 @@ describe('paramsSliceConfig persisted state migration', () => {
it('never repairs _version, so version detection cannot be bypassed', () => {
// `_version` is the input to the version steps, so the net must leave it alone. If it repaired
// it, any blob whose version is not the current literal — including one written by a *newer*
- // build — would be silently stamped v5 having run no step, and its stale field values would be
+ // build — would be silently stamped v8 having run no step, and its stale field values would be
// accepted as current. Deliberately not routed through migrate(): the version steps normalise
// `_version` before the net ever sees it, so only calling the net directly tests the guard.
// The blob is otherwise complete (the current tier's key set), so `_version` is the only thing
// the parse below can object to.
- const blob = buildReleaseBlob('f10d2a4f5a', { _version: 6, positivePrompt: 'a fluffy cat' });
+ const blob: Record<string, unknown> = { ...getInitialParamsState(), _version: 9, positivePrompt: 'a fluffy cat' };
const { backfilled, reset } = repairParamsState(blob);
expect(backfilled).toEqual([]);
expect(reset).toEqual([]);
- expect(blob._version).toBe(6);
+ expect(blob._version).toBe(9);
// Still fatal, which is the correct outcome for a downgrade: that slice really was written by a
// schema this build does not know.
expect(() => zParamsState.parse(blob)).toThrow();
@@ -1454,7 +1453,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(blob) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.positivePrompt).toBe('a fluffy cat');
expect(result.seed).toBe(7);
expect(result.dimensions).toBeDefined();
@@ -1471,7 +1470,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(v3State) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.wanTransformerLowNoise).toBeNull();
expect(result.wanComponentSource).toBeNull();
expect(result.wanVaeModel).toBeNull();
@@ -1493,7 +1492,7 @@ describe('paramsSliceConfig persisted state migration', () => {
const result = migrate?.(v2State) as ReturnType<typeof getInitialParamsState>;
- expect(result._version).toBe(5);
+ expect(result._version).toBe(8);
expect(result.fluxScheduler).toBe('euler');
expect(result.zImageScheduler).toBe('euler');
expect(result.colorCompensation).toBe(false);
@@ -1546,14 +1545,14 @@ describe('paramsSliceConfig persisted state migration', () => {
// reach for as long as 4 was current: a v4 blob matched no branch, so no step could seed it and
// a zod default was the only option. The PiD fields (3f5588f21f, one day after the bump) are the
// case that dev builds actually hit; the ERNIE-Image and HiDiffusion fields followed the same
- // route. main's v4 -> v5 step now also seeds the PiD fields, but the defaults are what covers
- // the same gap on the current tier, which by definition still has no step.
+ // route. The v4 -> v5 step now seeds the PiD fields; the defaults cover the analogous gap on
+ // the current v8 tier, which by definition still has no step.
const blob = buildReleaseBlob('1aeb05bbf0', { positivePrompt: 'a fluffy cat', seed: 42 });
expect('pidMode' in blob).toBe(false);
expect('hiDiffusionEnabled' in blob).toBe(false);
applyParamsVersionMigrations(blob);
- expect(blob._version).toBe(5);
+ expect(blob._version).toBe(8);
// The value assertions below cannot, on their own, prove the defaults exist: three mechanisms
// produce the identical values, so any two can hide the third being reverted. Parsing directly