The 17.0.0 save indexing change that caused improperly wiped consoles to not boot

This commit is contained in:
Alex Barney 2024-01-30 22:24:51 -07:00
parent 78e16d3d61
commit e6d32b96d0

View file

@ -1642,10 +1642,9 @@ internal class SaveDataFileSystemService : ISaveDataTransferCoreInterface, ISave
ulong saveDataId; ulong saveDataId;
SaveDataAttribute key = attribute; SaveDataAttribute key = attribute;
bool isStaticSaveDataId = attribute.StaticSaveDataId != InvalidSystemSaveDataId && attribute.UserId == InvalidUserId;
// Get the ID of the save data // Get the ID of the save data
if (isStaticSaveDataId) if (attribute.StaticSaveDataId == SaveIndexerId)
{ {
saveDataId = attribute.StaticSaveDataId; saveDataId = attribute.StaticSaveDataId;
} }
@ -1700,20 +1699,6 @@ internal class SaveDataFileSystemService : ISaveDataTransferCoreInterface, ISave
{ {
if (saveDataId != SaveIndexerId) if (saveDataId != SaveIndexerId)
{ {
if (isStaticSaveDataId)
{
// The accessor won't be open yet if the save has a static ID
Result res = OpenSaveDataIndexerAccessor(ref accessor.Ref, spaceId);
if (res.IsFailure()) return res.Miss();
// Check the space ID of the save data
res = accessor.Get.GetInterface().Get(out SaveDataIndexerValue value, in key);
if (res.IsFailure()) return res.Miss();
if (value.SpaceId != ConvertToRealSpaceId(spaceId))
return ResultFs.TargetNotFound.Log();
}
// Remove the indexer entry. Nintendo ignores these results // Remove the indexer entry. Nintendo ignores these results
accessor.Get.GetInterface().Delete(saveDataId).IgnoreResult(); accessor.Get.GetInterface().Delete(saveDataId).IgnoreResult();
accessor.Get.GetInterface().Commit().IgnoreResult(); accessor.Get.GetInterface().Commit().IgnoreResult();