migrateScreenCacheFile function

ScreenCacheFile? migrateScreenCacheFile(
  1. ScreenCacheFile? file
)

Format-version migration seam. A file from another format version is DISCARDED (treated as absent): its node IDs were minted by older stable-ID rules and would otherwise coexist forever with the new IDs for the same elements. The next capture rebuilds the screen from scratch.

Implementation

ScreenCacheFile? migrateScreenCacheFile(ScreenCacheFile? file) {
  if (file == null) return null;
  if (!isCurrentScreenCacheFormat(file.schemaVersion)) return null;
  return file;
}