After calling Realm::compact on a file, it appears the wrong file format version is written in the compacted copy. This causes Realm studio to prompt for an upgrade and if the schema mode is soft reset, it will wipe the data, even though no migration is required.