Persistable error when trying to publish

Trying to publish a new version of my map. There are no backwards compatibility errors when building Verse, when launching a session, pushing changes or verse changes, pushing a private version, or at any other time.

However, when I try to publish, there’s a red X next to my private version on the publish screen and this message on hover:

You can’t publish this version because your Verse persistable data is not backward compatible with your current active version. Please publish a new version from UEFN that is compatible with your current active version.

I haven’t changed my save data format or functionality; I haven’t made any updates to the verse file that it’s in. There should be no issue with backwards compatibility (and as I said, no other errors at any other time).

The only thing I can think of is that one of the variables in my save data (which is itself a class, as is recommended in the persistence documentation) is a map of type [enum]float, and I have updated the enum entries (I’ve only added enum entries, not removed). The enum is (and has been) set as persistable since the first implementation of the save data.

If that’s the issue, how do I make that backwards compatible and fix this issue?

So it appears that changing an enum that’s used as a Key in a map leads to the backwards compat issue.

So the issue then becomes: how do I create a new version of this save data variable?

I can’t update the enum, or else that breaks it. I can’t create a new enum for my code as it breaks a bunch of other of my map implementation. I can’t create a new save variable that doesn’t use the enum as a key, because the old one still has to be there. I can’t rollback to a previous publish version, because the first published version contains this same save data.

A common way would be to make migration scripts, add a new field, read the current player data version and migrate accordingly, I believe they talk about it a bit in their article :eyes:

But how do you migrate in this situation?

Is it going to have to be:

  • Publish a new version that migrates from the old data to new data (v1)
  • Publish a new version that eliminates the old data (v2)
  • Publish a new version that adjusts the enum?

Or does that map have to be there in the save data forever? In which case, I can never adjust the enum?

Can we make enums hierarchical?

baseEnum := enum{a, b, c, d} #v1(No change)
extrEnum := enum{d1, d2, d3, d4} #v2(Add)

In the above case(Sorry, not tested.), we have given a special role to the base d element.

Did you figure this out? I am getting same issue.

I did not figure it out. I suppose you could do like was suggested in Persistable error when trying to publish - #4 by farginnoob, but for my purposes that was not a viable change I could make.

So my solution was to duplicate the map and instead of using the enum as the map key, convert the enum to string and use a string as a key instead going forward. I suppose you could possibly deprecate your enum and create a new enum and convert that to string without duplicating the map, but depending on your verse infrastructure, it may not be a great solution.